All pastes #121421 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-08-08 00:23 UTC
rendered paste body
menu channel {
  Friends List:{ 
    dialog -m nick nick
  }
}
menu NickList {
  Add { 
    set %friend $1
    write friends.txt $1
    notify $1
    if (%dialog.nick == on) {
      did -a nick 4 %friend
      while (%1 < $did(nick,4).lines) {
        inc %1 1
        if ($gettok($did(nick,4,%1),1,32) isin %friend) {
          did -o nick 4 %1 $gettok($did(nick,4,%1),1,32) $iif($notify($did(nick,4,%1)).ison == $true,online,offline)  
        }
      }
      //echo -a You Have Added $1 To Your Friends List.
    }
  }
}
alias RSHS dialog -m stats stats
dialog stats {
  title "RS HIGH SCORE LOOK-UP"
  size -1 -1 200 200
  option dbu
  text "Combat:", 1, 82 10 20 10, left
  text "Overall:" 2, 133 10 25 10, left 
  text "Nickname:", 3, 5 10 25 10, left
  edit "", 30, 31 10 50 10, left
  edit "", 31, 104 10 28 10, left
  edit "", 32, 152 10 28 10, left
  button "Look UP!", 99, 31 20 25 10, left
  text "Attack:", 4, 5 35 25 10, left
  edit "", 33, 30 35 10 10, left
  text "Strength:", 5, 5 50 25 10, left
  edit "", 34, 30 50 10 10, left
  text "Defence:", 6, 5 65 25 10, left
  edit "", 35, 30 65 10 10, left
  text "Magic:", 7, 5 80 25 10, left
  edit "", 36, 30 80 10 10, left
  text "Range:", 8, 5 95 25 10, left
  edit "", 37, 30 95 10 10, left
  text "HitPoints:", 9, 5 110 25 10, left
  edit "", 38, 30 110 10 10, left
  text "Prayer:", 10, 5 125 25 10, left
  edit "", 39, 30 125 10 10, left
  text "Agility:", 11, 5 140 25 10, left
  edit "", 40, 30 140 10 10, left


  text "Herblore:", 12, 45 35 25 10, left
  edit "", 41, 70 35 10 10, left
}
alias google dialog -m google google
dialog google {
  title "Google - I'm Feeling Lucky Results"
  size -1 -1 200 25
  option dbu 
  edit "", 1, 5 5 190 10, center 
}
on *:dialog:google:init:*:{
  did -o google 1 1 %goog
  sockclose google
}
on *:dialog:nick:dclick:*:{
  query $did(nick,4).seltext
}
alias nonick dialog -m nnick nnick
dialog nnick {
  title "Error", center
  size -1 -1 140 25
  option dbu 
  text "Please select a nickname from your friends list before you click the Remove button", 1, 5 5 130 15, center 
}
alias notext dialog -m ntext ntext
dialog ntext {
  title "Error", center
  size -1 -1 140 25
  option dbu 
  text "Please type a nickname into the edit box, then press submit.", 1, 5 5 130 15, center 
}
alias nowhois dialog -m nwhois nwhois
dialog nwhois {
  title "Error", center
  size -1 -1 140 25
  option dbu 
  text "Please select a nickname from your friends list before you click the whois button", 1, 5 5 130 15, center 
}
alias Russl dialog -m link link
dialog link {
  title "RussellReal's Scripting Forum"
  size -1 -1 140 25
  option dbu 
  text "RussellReal's Scripting Forum:", 1, 5 5 130 10, center 
  link "http://z7.invisionfree.com/Scripting_Fun/index.php", 2, 9 15 130 10, center
}
on *:dialog:link:sclick:2:{
  //run http://z7.invisionfree.com/Scripting_fun
}
alias whoisd dialog -m whois whois
dialog whois {
  title "Whois Results"
  size -1 -1 250 140
  option dbu 
  text "Hostmask", 1, 100 5 50 10, center
  edit "User is offline", 2, 5 16 240 10, center
  text "Identified?", 3, 100 31 50 10, center
  edit "User is offline or isn't identified", 4, 5 42 240 10, center
  text "Channels", 5, 100 56 50 10, center
  edit "User is offline", 6, 5 67 240 10, center
  text "Server", 7, 100 82 50 10, center
  edit "User is offline", 8, 5 93 240 10, center
  text "Idle Time", 9, 100 108 50 10, center
  edit "Idle Time UnRetrievable", 10, 5 119 240 10, center
}
alias nk dialog -m nick nick 
dialog nick {
  title "Russell's Friendslist"
  size -1 -1 127 242
  option dbu 
  text "Friends List, Created by RussellReal.", 10, 3 1 94 10, left
  text "Nickname To Add", 1, 3 7 94 10, left
  edit "", 2, 2 15 70 13, left 
  Button "Submit", 3, 74 15 25 13, Right
  list 4, 2 30 123 150, left
  button "Remove", 5, 22 177 83 21, left
  button "Query", 6, 1 177 20 10, left
  button "Notice", 7, 1 188 20 10, left
  button "Whois", 8, 106 177 20 10, left
  button "Invite", 9, 106 188 20 10, left
  button "My Site", 11, 100 1 23 9, right
  button "Clear All", 12, 99 15 25 13, Right 
  text "Google Search - I'm Feeling Lucky", 13, 1 200 126 10, center
  edit "", 14, 1 209 126 10, left
  button "I'm Feeling Lucky!", 15, 30 220 66 10
  button "Rs High Scores!", 16, 30 231 66 10
}
on *:dialog:nick:close:*:{
  set %dialog.nick off
}
on *:dialog:nick:init:0:{
  set %dialog.nick on
  var %f = 0
  while (%f < $lines(friends.txt)) {
    inc %f 1
    did -a nick 4 $read(friends.txt, %f)
  }
  var %1 = 0
  while (%1 < $did(nick,4).lines) {
    inc %1 1
    did -o nick 4 %1 $gettok($did(nick,4,%1),1,32) $iif($notify($did(nick,4,%1)).ison == $true,online,offline)  
  }
}
on *:dialog:nick:sclick:*:{
  if ($did == 3) {
    if ($did(nick,2) != $null) {
      set %friend $did(nick,2).text
      notify %friend
      did -a nick 4 %friend
      write friends.txt %friend
      did -r nick 2
      while (%1 < $did(nick,4).lines) {
        inc %1 1
        if ($gettok($did(nick,4,%1),1,32) isin %friend) {
          did -o nick 4 %1 $gettok($did(nick,4,%1),1,32) $iif($notify($did(nick,4,%1)).ison == $true,online,offline)  
        }
      }
    }
    else { notext }
  } 
  if ($did == 5) {
    if ($did(nick,4).seltext == $null) { nonick }
    else {
      notify -r $did(nick,4).seltext 
      write -ds $+ $gettok($did(nick,4).seltext,1,32) friends.txt 
      did -d nick 4 $did(nick,4).sel
    }
  }
  if ($did == 6) { query $gettok($did(nick,4).seltext,1,32) }
  if ($did == 7) { notice $gettok($did(nick,4).seltext,1,32) $?="Enter The Message You Wish To Send To $gettok($did(nick,4).seltext,1,32) $+ " }
  if ($did == 8) {
    if ($did(nick,4).seltext == $null) { nowhois }
    else {
      set %Whois $gettok($did(nick,4).seltext,1,32)
      whois $gettok($did(nick,4).seltext,1,32)
      whoisd
      enable #whois
    }
  }
  if ($did == 9) { invite $gettok($did(nick,4).seltext,1,32) $?="Enter The Channel You Wish To Invite $did(nick,4).seltext Into" }
  if ($did == 11) { russl }
  if ($did == 12) { 
    var %a = 0
    while (%a < $did(nick,4).lines) {
      inc %a 1
      notify -r $gettok($did(nick,4,%a),1,32)
    }
    did -r nick 4
    remove friends.txt
  }
  if ($did == 15) {
    if ($did(nick,14) != $null) {
      /set %lookup $replace($did(nick,14),$chr(32),+)
      /sockopen google www.google.com 80
    }
    else { halt }
  }
  if ($did == 16) { RSHS }
}

#whois on
raw 311:* {
  if (%dialog.nick == on) {
    set %311 $3-
    did -r whois 2
    did -a whois 2 %311 
  }
}
raw 307:* {
  if (%dialog.nick == on) {
    set %307 $3-
    did -r whois 4
    did -a whois 4 %307 
  }
}
raw 313:* {
  if (%dialog.nick == on) {
    set %313 $3- 
  }
}
raw 312:* {
  if (%dialog.nick == on) {
    set %312 $3
    did -r whois 8
    did -a whois 8 %312 
  }
}
raw 317:* {
  if (%dialog.nick == on) {
    set %317 $duration($3)
    did -r whois 10
    did -a whois 10 %317 
  }
}
raw 319:* {
  if (%dialog.nick == on) {
    set %319 $3-
    did -r whois 6
    did -a whois 6 %319 
  }
}
#whois end
on *:NOTIFY:{
  if (%dialog.nick == on) {
    set %blah $nick
    var %h = 0
    while (%h < $did(nick,4).lines) {
      inc %h 1
      if ($gettok($did(nick,4,%h),1,32) isin %blah) {
        did -o nick 4 %h $gettok($did(nick,4,%h),1,32) online
      }
    }
  }
}
on *:UNOTIFY:{
  if (%dialog.nick == on) {
    set %blah1 $nick
    var %h = 0
    while (%h < $did(nick,4).lines) {
      inc %h 1
      if ($gettok($did(nick,4,%h),1,32) isin %blah1) {
        did -o nick 4 %h $gettok($did(nick,4,%h),1,32) offline
      }
    }
  }
}
on *:sockopen:google:{
  sockwrite -nt $sockname GET /search?hl=en&q= $+ %lookup $+ &btnI=I%27m+Feeling+Lucky HTTP/1.1
  sockwrite -nt $sockname Host: www.google.com $+ $crlf $+ $crlf
}
on *:sockread:google:{
  if ($sockerr) {
    echo -a Error.
    halt
  }
  else {
    sockread %temptext
    tokenize 32 $htmlfree(%temptext)
    if $1 == location: {
      set %goog $2
      google
    }
  }
}
on *:SOCKCLOSE:google:{
  unset %check
  unset %goog
  unset %temptext
}
on *:SOCKOPEN:dstat:{
  sockwrite -nt $sockname GET /statpage.php?user= [ $+ [ %lookup.d ] ]  HTTP/1.1
  sockwrite -nt $sockname Host: rscript.org $+ $crlf $+ $crlf
  if (%cmb) {
    sockrename $sockname dcmb
  }
  if (%skill) {
    sockrename $sockname dskill
  }
}
on *:SOCKREAD:dstat:{
  var %total | sockread -f %total
  tokenize 32 $remove(%total,Stat:)
  if (*does not feature* iswm $1-) { did -er stat 31-38,70-84 | sockclose $sockname }
  if (Attack == $1) { did -eo stat 31 1 $iif($3 isnum,$3,NA) }
  if (Hitpoints == $1) { did -eo stat 32 1 $iif($3 isnum,$3,NA) }
  if (Prayer == $1) { did -eo stat 33 1 $iif($3 isnum,$3,NA) }
  if (Strength == $1) { did -eo stat 34 1 $iif($3 isnum,$3,NA) }
  if (Defence == $1) { did -eo stat 37 1 $iif($3 isnum,$3,1) }
  if (Ranged == $1) { did -eo stat 38 1 $iif($3 isnum,$3,NA) }
  if (Magic == $1) { 
    did -eo stat 35 1 $iif($3 isnum,$3,NA)
    did -eo stat 36 1 $cmbcalc($did(stat,31),$iif($did(stat,37) != NA,$did(stat,37),1),$did(stat,34),$did(stat,32),$did(stat,33))
  }
  if (Herblore == $1) { did -eo stat 81 1 $iif($3 isnum,$3,NA) }
  if (Agility == $1) { did -eo stat 80 1 $iif($3 isnum,$3,NA) }
  if (Thieving == $1) { did -eo stat 79 1 $iif($3 isnum,$3,NA) }
  if (Crafting == $1) { did -eo stat 72 1 $iif($3 isnum,$3,NA) }
  if (Fletching == $1) { did -eo stat 76 1 $iif($3 isnum,$3,NA) }
  if (Slayer == $1) { did -eo stat 82 1 $iif($3 isnum,$3,NA) }
  if (Mining == $1) { did -eo stat 70 1 $iif($3 isnum,$3,NA) }
  if (Smithing == $1) { did -eo stat 71 1 $iif($3 isnum,$3,NA) }
  if (Fishing == $1) { did -eo stat 73 1 $iif($3 isnum,$3,NA) }
  if (Cooking == $1) { did -eo stat 74 1 $iif($3 isnum,$3,NA) }
  if (Runecraft == $1) { did -eo stat 78 1 $iif($3 isnum,$3,NA) }
  if (Firemaking == $1) { did -eo stat 75 1 $iif($3 isnum,$3,NA) }
  if (Woodcutting == $1) { did -eo stat 77 1 $iif($3 isnum,$3,NA) }
  if (Farming == $1) { did -eo stat 83 1 $iif($3 isnum,$3,NA) }
  if (Construction == $1) {
    did -eo stat 84 1 $iif($3 isnum,$3,NA)
    sockclose $sockname
  }
}
alias cmbcalc { 
  return $calc((0.32707*$1)+(0.249*$2)+(0.324*$3)+(0.25*$4)+(0.124*$5))
}