SwiftIRC FAQ Search Memberlist Usergroups Log out [ Lord_rut ] Profile :: You have no new messages SwiftIRC Forum Index » mIRC Scripting » cmb + stats + single skills + name saving Goto page 1, 2, 3 Next cmb + stats + single skills + name saving « View previous topic :: View next topic » Author Message Urza Posted: Sat Mar 18, 2006 3:44 pm Post subject: cmb + stats + single skills + name saving Addict Rank: Addict Joined: 04 Feb 2006 Posts: 352 Like the name [sorta] says, its yet another stats script, including commands to look up all stats, single skills or combat, and to allow name saving (by nick OR by host 3) !cmb [RSN] Lookup combat !stats [RSN] Lookup all stas !SKILL [RSN] Lookup specified SKILL !setrsn [RSN] Save RSN by nick !setrsn -h [RSN] Save RSN by host 3 Also this is my first ever scrpt using Binvars, and doesnt use teh PHP page at all (thx to thegame for that since his script inspired me to actually bother reading up about binvars and gave me the basis on how to use them for this) feel free to rip it apart Its only been lightly tested so there's sure to be errors in there somewhere but i dont think theres any major bugs Code: alias c1 { return $+(,$1-) } alias c2 { return $+(,$1-) } on *:text:*:#: { tokenize 32 $strip($1-) if ($left($1,1) !isin @!.) halt if ($right($1,-1) == stats) var %style = astats elseif ($regex($1,/co?mb(at)?/Si)) var %style = combat elseif ($setskill($remove($1,@,!,.))) var %style = istat, %skill = $setskill($remove($1,@,!,.)) elseif ($right($1,-1) == setrsn) && ($2) { if ($2 == -h) { writeini DefRSN.ini RSNs $mask($fulladdress,3) $replace($3-,$chr(32),-) .notice $nick You're default RSN for the host $mask($fulladdress,3) has been set to $3- } else { writeini DefRSN.ini RSNs $nick $replace($2-,$chr(32),-) .notice $nick You're default RSN for the nick $nick has been set to $2- } halt } else halt inc %ID if ($len($2-) > 12) { $($+(%,stats.display.,%ID),2) $c1(The nick) $c2($2-) $c1(is too long) cleanup %ID halt } elseif ($2) set $+(%,stats.rsn.,%ID) $replace($2-,$chr(32),-) elseif ($readini(DefRSN.ini,RSNs,$mask($fulladdress,3))) set $+(%,stats.rsn.,%ID) $ifmatch elseif ($readini(DefRSN.ini,RSNs,$nick)) set $+(%,stats.rsn.,%ID) $ifmatch else set $+(%,stats.rsn.,%ID) $nick set $+(%,stats.style.,%ID) %style set $+(%,stats.skill.,%ID) %skill set $+(%,stats.display.,%ID) $iif($left($1,1) == @,msg $chan,notice $nick) sockopen $+(stats.,%ID) hiscore.runescape.com 80 } on *:sockopen:stats.*: { var %id = $gettok($sockname,2,46) sockwrite -n $sockname GET /lang/en/aff/runescape/hiscorepersonal.ws?user1= $+ $($+(%,stats.rsn.,%ID),2) HTTP/1.1 sockwrite -n $sockname Host: hiscore.runescape.com $+ $crlf $+ $crlf } on *:sockread:stats.*: { sockread &Incoming bwrite $sockname -1 -1 &Incoming if ($bfind(&Incoming, 1, ).text) makehash $sockname elseif ($bfind(&Incoming, 1, does not feature in the hiscores.).text) { $($+(%,stats.display.,%ID),2) $c1(The nick) $c2($($+(%,stats.rsn.,%ID),2)) $c1(Does not appear in the hiscores) cleanup $gettok($sockname,2,46) } } alias -l makehash { var %file = $1 bread %file 1 $file(%file).size &stats var %currentstat, %x = 1 while (%x) { var %x = $bfind(&stats,$calc(%x + 1),