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
}
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>. }
}
}
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 #
}
}
}
}
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.