Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- alias greet {
- if ($1 == update) {
- var %name $hget(greet,name)
- sockopen greet hiscore.runescape.com 80
- sockmark greet %name
- }
- elseif ($1 == set) {
- if (!$2) || (!$3) { echo -a Error: you must specify something to set and a value! | halt }
- if ($2 == name) {
- hadd -m greet name $3
- echo -a You have updated your name to $3 $+ !
- }
- elseif ($2 == timer) {
- hadd -m greet timer $calc($3 *60)
- .timergreet 9999 $calc($3 *60) greet update
- echo -a You have updated the timer to $3 minute intervals!
- }
- elseif ($2 == notice) {
- hadd -m greet notice $iif($3 == on,on,off)
- echo -a You have turned notices $iif($3 == on,on,off) $+ !
- }
- elseif ($2 == start) {
- hadd -m greet start $3
- echo -a You have set the start to $3
- }
- elseif ($2 == end) {
- hadd -m greet end $3
- echo -a You have set the end to $3
- }
- hsave greet greet.hsh
- }
- }
- alias gret { if ($prop == s) { return $hget(greet,start) } | elseif ($prop == e) { return $hget(greet,end) } }
- alias -l hs { tokenize 44 $hget(greet,$skill($1)) | if ($prop == r) { return $1 } | elseif ($prop == x) { return $3 } | else { return $2 } }
- alias -l na { return $iif($len($1) isnum 4-6,$bytes($calc($1 /1000),3d) $+ K,$iif($len($1) isnum 7-9,$bytes($calc($1 /1000000),3d) $+ M,$iif($len($1) isnum 10-12,$bytes($calc($1 /1000000000),3d) $+ B,$1))) }
- alias -l skill { var %a = Overall,Attack,Defence,Strength,Hitpoints,Ranged,Prayer,Magic,Cooking,Woodcutting,Fletching,Fishing,Firemaking,Crafting,Smithing,Mining,Herblore,Agility,Thieving,Slayer,Farming,Runecrafting,Hunter,Construction,Summoning) | return $gettok(%a,$1,44) }
- alias -l cmb {
- tokenize 32 $1
- if ($calc($1 + $2) > $calc($6 *1.5)) && ($calc($1 + $2) > $calc($7 *1.5)) { var %type = melee }
- else { var %type $iif($6 < $7,magic,range) }
- var %a = $calc(100 * $3)
- var %b = $calc(100 * $4)
- var %c = $calc($iif(2 // $5,50 * $5,50 * $calc($5 -1)))
- var %d = $iif($prop = p2p,$calc($iif(2 // $8,50 * $8,$iif($8 != 1,50 * $calc($8 -1),50))),0)
- var %base = $calc((%a + %b + %c + %d)/400)
- if (%type == melee) return $calc(($1 * 130 + $2 * 130)/400 + %base)
- elseif (%type == range) return $calc($iif(2 // $6,$6 * 195,$calc($6 * 195 - 65))/400 + %base)
- elseif (%type == magic) return $calc($iif(2 // $7,$7 * 195,$calc($7 * 195 - 65))/400 + %base)
- }
- on *:SOCKOPEN:greet:{
- var %s $sockname
- sockwrite -nt %s GET $+(/index_lite.ws?player=,$sock(%s).mark)
- sockwrite -nt %s Host: hiscore.runescape.com
- sockwrite -nt %s $crlf
- }
- On *:START:{
- hmake greet 30
- hload greet greet.hsh
- }
- on *:SOCKREAD:greet:{
- var %s = $sockname
- if ($sockerr) {
- echo -a SOCKET ERROR! greet has failed with -> $sock(%s).wsmsg | sockclose %s | halt
- }
- var %g
- sockread %g
- if (404 - Page not found isin %g) {
- echo -a $sock(%s).mark isn't in the highscores! | sockclose %s | halt
- }
- elseif (*,*,* iswm %g) {
- var %a 1
- while (%a <= 26) {
- hadd -m greet $skill(%a) %g
- sockread %g
- inc %a
- }
- if (%a == 27) {
- goto end
- }
- :end
- var %cmb1 = $cmb($hs(2) $hs(4) $hs(3) $hs(5) $hs(7) $hs(6) $hs(8) $hs(25)).p2p
- var %cmb2 = $cmb($hs(2) $hs(4) $hs(3) $hs(5) $hs(7) $hs(6) $hs(8) $hs(25))
- var %greet $gret().s $hs(1) $+ /2496 : $na($hs(1).x) $+ /417,099,511. total %cmb1 $+ / $+ %cmb2 $+ /138.35 $gret().e
- ns set greet %greet
- hadd -m greet last %greet
- .timergreet 9999 $hget(greet,timer) greet update
- sockclose greet
- }
- }
- on ^*:NOTICE:*:?:{
- if ($nick == Nickserv) && ($hget(greet,last) isin $1-) {
- if ($hget(greet,notice) == on) {
- haltdef
- echo -a Greet has been updated!
- }
- else {
- haltdef
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement