pickpocket game

By Stewie1k94 on May 14, 2011

Updated! Leave some feedback for any improvements that could be made..

!additem/!delitem item, !pickpocket nick

on *:LOAD:{ var %f = pickpocket.txt | if (!$read(%f)) { write %f Recipt | write %f Memory Locket | write %f Lighter } | echo -a Three items have been added for you! }
on $*:TEXT:/^!additem( |$)/Si:#:{
  var %f = pickpocket.txt, %pp.item = $2-
  if ($read(%f,nw,$+(*,%pp.item,*))) { msg $chan $nick $+ , this item has already been added. Maybe add something else? | return }
  write %f %pp.item 
  msg $chan Item added! Thank you.
}
on $*:TEXT:/^!delitem( |$)/Si:#:{
  var %f = pickpocket.txt, %pp.item = $2-
  if (!$read(%f,nw,$+(*,%pp.item,*))) { msg $chan $nick $+ , I do not have that item stored. | return }
  write -dl $+ $readn %f 
  msg $chan I have removed $qt(%pp.item) from the game. 
}
on $*:TEXT:/^!pickpocket( |$)/Si:#:{
  var %f = pickpocket.txt, %r.item = $read(pickpocket.txt)
  if (!%r.item) { 
    msg $chan I do not have anything to pickpocket - !additem <item> 
    return 
  }
  if ($2 == $me) { describe $chan slaps $nick $+ ! No!  | return }
  if ($2 == $null) { msg $chan The correct format is !pickpocket <nick>. | return }
  if ($2 !ison $chan) { msg $chan You cannot pickpocket someone who isn't here! | return }
  .timer 1 1 describe $chan Walks up to $2 quietly!
  .timer 1 3 describe $chan Reaches into $2 $+ 's pockets and finds... a %r.item
}

Comments

Sign in to comment.
Stewie1k94   -  Sep 12, 2012

Updated with a on LOAD event for a couple of preloaded items.

 Respond  
Stewie1k94   -  Oct 15, 2011

And updated to:

alias item { return $read(pickpocketgame.txt) }
on *:TEXT:*:#:{
  if ($1 == !additem) && ($regex($nick($chan,$nick).pnick,/(~|&|@)/)) {
    if (!$read(pickpocketgame.txt, w, $2)) {
      write pickpocketgame.txt $2-
      msg # $2- has been added to the pickpocket game.
    }
    else { msg # That item has already been added. }
  }
  if ($1 == !delitem) && ($regex($nick($chan,$nick).pnick,/(~|&|@)/)) {
    if ($read(pickpocketgame.txt, w, $2)) {
      write -dl $+ $2- pickpocketgame.txt 
      msg # $2- has been deleted from the pickpocket game.
    }
    else { msg # That item has not been added to delete. }
  }
  if ($1 == !pickpocket) {
    if ($2 != $null) {
      if ($2 ison $Chan) {
        if (!%floods) {
          msg # $me Walks up to $2 silently 
          msg # $me Reaches in $2 $+ 's pocket, and finds a/an: $item $+ .
          inc -u3 %floods
        }
        else { msg # $nick $+ , you must wait alteast 3 seconds before using this command again. }
      }
      else { msg # $2 is not on this channel. }
    }
    else { msg # Correct command is: !pickpocket <Nick>. }
  }
}
 Respond  
Stewie1k94   -  Oct 15, 2011

What's your point?

 Respond  
jasonh   -  Oct 15, 2011

toclafane1 it means you arent concerned with it. also, dictionaries are good for looking up the meaning of words.

 Respond  
Stewie1k94   -  May 15, 2011

and i have have no idea what nonchalant means

 Respond  
Stewie1k94   -  May 15, 2011

ok the

$+

has been removed

 Respond  
Jethro   -  May 14, 2011

It's fine by him. He seems nonchalant about this snippet...

 Respond  
napa182   -  May 14, 2011

toclafane1 Wrote:

its fine for me
um idk how it could be with lines like

timer 1 1 msg $chan $+ $me walks up to $2 silently
 Respond  
Stewie1k94   -  May 14, 2011

I've taken the liberty of adding some checks that your faulty script is lacking:

its fine for me

 Respond  
Jethro   -  May 14, 2011

I've taken the liberty of adding some checks that your faulty script is lacking:

on $*:text:/^!(add|del)item|(pickpocket)( |$)/iS:#:{
  if ($nick == your nick here) {
    var %file = pickpocket.txt, %item = $2-
    if (!%item) {
      .notice $nick please specify an item to add or delete:
      .notice $nick !additem <Items Here>
      .notice $nick !delitem <Items Here>
      .notice $nick !pickpocket <NickHere>
      return
    }
    if ($regml(1) == add) {
      if (!$read(%file,nw,$+(*,%item,*))) {
        write %file %item
        .msg # %item has been added to the pickpocket game.
      }
      else { 
        .msg # $qt(%item) already added! Please add another items. 
      }
    }
    elseif ($regml(1) == del) {
      if ($read(%file,nw,$+(*,%item,*))) {
        write $+(-dl,$readn) %file
        .msg # %item has been deleted from the pickpocket game.
      }
      else { 
        .msg # $qt(%item) is either removed or doesn't exist! 
      }
    }
    else {
      if (!$2) { 
        .msg # You need someone to pickpocket. 
      }
      elseif ($2 ison #) {
        .timer 1 1 .msg # $+($chr(2),$me walks up to $2 silently)
        .timer 1 2 .msg # $me reaches in $2 $+ 's pocket and finds
        .timer 1 3 .msg # $read(%file)
      }
      else { 
        .msg #  $+ $2 is not on # 
      }
    }
  }
}
 Respond  
Stewie1k94   -  May 14, 2011

so what do u suggest is done to it

 Respond  
Stewie1k94   -  May 14, 2011

and i took the bits out under the on *:TEXT as there the bits to turn the bot on and off lol
and thank for your rating

 Respond  
napa182   -  May 14, 2011

you may have tested it, but ur snippet didn't work for me all i get is error after error...
so out of all i said in my last comment you came away with the testing part. =/
2/10 for incomplete

 Respond  
Stewie1k94   -  May 14, 2011

and it dont screw it up for me

 Respond  
Stewie1k94   -  May 14, 2011

i did test them

 Respond  
napa182   -  May 14, 2011

You should add a few preloaded items to it. You should really name an silence your timers. Also where is the var %bot [ $+ [ $chan ] ] set at?
um on some of ur lines you have it like this " $chan $+ $me " take out the $+ or it will screw it up.

You should really test ur snippets before you post them.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.