All pastes #401105 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-03-19 03:01 UTC
rendered paste body
on $*:TEXT:/^[!@](setname|defname)/Si:#:{
  writeini idlenames.ini Nicks $address($nick,1) $2-
  .notice $nick $c2(Your default name for) $c1($address($nick,1)) $c2(has been set to) $c1($2-)
}
on $*:text:/^[!@](idle|idlestats)/Si:#: {  
  set %idle.way $iif($left($1,1) == @, .msg $chan, .notice $nick) 
  if (!$2) && ($readini(idlenames.ini,n,Nicks,$address($nick,1))) {
    set %idle.nick $readini(idlenames.ini,n,Nicks,$address($nick,1))
  }
  elseif (!$2) { set %idle.nick $nick
  }
  else {
    set %idle.nick $2- 
  }
  sockopen IRPG www.xnemesis.net 80 
} 
on *:SOCKOPEN:IRPG: { 
  sockwrite -nt $sockname GET /superirc/irpg/playerview.php?player= $+ %idle.nick
  sockwrite -nt $sockname Host: www.xnemesis.net 
  sockwrite -nt $sockname $crlf $crlf 
} 
on *:SOCKREAD:IRPG: { 
  if ($sockerr) { echo -at ** Error ** in scoket: $sockerr | halt } 
  else { 
    var %sockreader 
    sockread %sockreader
    if (*<b>No such user.</b>* iswm %sockreader) { %idle.way $c2(ERROR: User) $c1(%idle.nick) $c2(was not found.) | unset %idle.* | set %idle.wrong 1 | halt }
    if (*<b>Level:</b>* iswm %sockreader) { tokenize 32 %sockreader | set %idle.lvl $nohtml($2) }
    if (*<b>Class:</b>* iswm %sockreader) { tokenize 32 %sockreader | set %idle.class $nohtml($2-) }
    if (*<b>Next level:</b>* iswm %sockreader) { tokenize 32 %sockreader | set %idle.nxtlvl $nohtml($remove($2-,level:)) }
    if (*<b>Total time idled:</b>* iswm %sockreader) { tokenize 32 %sockreader | set %idle.total $nohtml($remove($2-,time idled:)) }
    if (*sum:* iswm %sockreader) { tokenize 32 %sockreader | set %idle.sum $nohtml($2-) }
    if (*<b>Status:</b>* iswm %sockreader) { tokenize 32 %sockreader | set %idle.status $nohtml($2-) }
    if (*[<font color="#be9256">* iswm %sockreader) { tokenize 32 %sockreader | %idle.specits = %idle.specits $nohtml($remove($3-,[,])) - }
    if (*<b>Alignment:</b>* iswm %sockreader) { tokenize 32 %sockreader | set %idle.align $nohtml($2-) }
    if ($regex(%sockreader,.(0[1-9]|1[012])[/](0[1-9]|[12][0-9]|3[01])[/]07)) { tokenize 32 %sockreader | set %idle.charmods $nohtml([ $+ $2-) }
  }
}
on *:sockclose:IRPG: {
  if ($var(%idle.wrong)) {
    unset %idle.wrong | halt
  }
  else {
    %idle.way $c2(Player info for :**) $c1(%idle.nick) $c2(**:) 
    %idle.way $c2(Level:) $c1(%idle.lvl) $c2(Next level in:) $c1(%idle.nxtlvl) $c2(Total Time Idled:) $c1(%idle.total) $c2(Class:) $c1(%idle.class) $c2(Item Sum:) $c1(%idle.sum) $c2(Status:) $c1(%idle.status) $c2(Alignment:) $c1(%idle.align) 
    %idle.way $c2(Recent Character Modifications:) $c1(%idle.charmods) 
    if ($var(%idle.specits)) {
      %idle.way $c2(Special Items:) $c1(%idle.specits)
    }
    else {
      %idle.way $c2(Special Items:) $c1(NONE)
    }
    unset %idle.*
  }
}
on $*:TEXT:/^[!@](quest|idlequest)/Si:#:{
  .set %quest.way $iif($left($1,1) == @,.msg $chan,.notice $nick)
  .sockopen QUEST www.xnemesis.net 80
}
on *:SOCKOPEN:QUEST: {
  sockwrite -nt $sockname GET /superirc/irpg/quest.php
  sockwrite -nt $sockname Host: www.xnemesis.net 
  sockwrite -nt $sockname $crlf $crlf 
}
on *:SOCKREAD:QUEST: {
  if ($sockerr) { echo -at ** Error ** in socket: $sockerr | halt } 
  else { 
    var %questit 
    sockread %questit
    if (*<p>Sorry, there is no active quest.</p>* iswm %questit) {
      %quest.way $c1(Sorry, there is no active quest for the) $c2(SuperIRC) $c1(network.)
      unset %quest.*
      set %quest.wrong 1
      halt
    }
    if (*<p><b>Quest:</b>* iswm %questit) {
      tokenize 32 %questit
      set %quest.info $nohtml($2-)
    }
    if (*p><b>Participant 1:</b>* iswm %questit) {
      tokenize 32 %questit
      set %quest.par1 $nohtml($3-)
    }
    if (*p><b>Participant 2:</b>* iswm %questit) {
      tokenize 32 %questit
      set %quest.par2 $nohtml($3-)
    }
    if (*p><b>Participant 3:</b>* iswm %questit) {
      tokenize 32 %questit
      set %quest.par3 $nohtml($3-)
    }
    if (*p><b>Participant 4:</b>* iswm %questit) {
      tokenize 32 %questit
      set %quest.par4 $nohtml($3-)
    }
    if (*<b>Position:</b>* iswm %questit) {
      tokenize 32 %questit
      if (!%quest.po1) set %quest.po1 $nohtml($2)
      elseif (!%quest.po2) set %quest.po2 $nohtml($2)
      elseif (!%quest.po3) set %quest.po3 $nohtml($2)
      elseif (!%quest.po4) set %quest.po4 $nohtml($2)
    }
    if (*<p><b>Current Goal:</b>* iswm %questit) {
      tokenize 32 %questit
      set %quest.goal $nohtml($3-)
    }
  }
}
on *:SOCKCLOSE:QUEST: {
  if ($var(%quest.wrong)) {
    unset %quest.wrong | halt
  }
  else {
    %quest.way $c2(Current Quest Info:) $c1(%quest.info)
    %quest.way $c2(Quest Goal:) $c1(%quest.goal)
    %quest.way $c2(Participant's: 1:) $c1(%quest.par1) $c2(Position:) $c1(%quest.po1) $c2(2:) $c1(%quest.par2) $c2(Position:) $c1(%quest.po2) $c2(3:) $c1(%quest.par3) $c2(Position:) $c1(%quest.po3) $c2(4:) $c1(%quest.par4) $c2(Position:) $c1(%quest.po4)
  }
  unset %quest.*
}
;;;------------------------------