mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Apr 2003
Posts: 25
S
SS217 Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Apr 2003
Posts: 25
Okay, guys, I've been working on a script to invite users once a player left the game. After that it should remove your name from the list and move on to the next person, I would like it first person to !Remember first person paged, So here's how it should work.
1) I'm stuck on removing the player name from the list after he gets invited.
2)Firts person first page basis.

------------------------------------------------------------------------
Player B types /page JTeKSvR02 !Remember
It shows up in IRC like this
<@JTeKBoT>[Page]PlayerB:!Remember
(JTeKGuarD then sees it and writes Player B to text file remember.txt)
(then Player A left the game so..)
<@JTeKBoT>Player A has left the game.
<@JTeKGuarD>!page PlayerB Hey, a spot is open in JTeKSvR02! Quick! Join!
(JTeKGuarD removes name from list)

-----------------------------------------------------------------
on *:TEXT:*!Remember*:#jtekbot: {
write remember.txt $replace($1,:, )
}
on *:TEXT:*Player*left the game*:#jtekbot: {
if !$read(remember.txt) { halt }
msg $chan !page $replace($1,:, ) A spot is open in JTeKSvR02 quick! join!
}

I don't know if that's right or not, I can't tell really since I sit in IRC, when I used $nick it only invited you if you said Player ... left the game

Ty. I would like to stay away from variables until I find a good resource on them. If you do know any please tell me.

Joined: Apr 2003
Posts: 25
S
SS217 Offline OP
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Apr 2003
Posts: 25
Sometimes I don't think.. I swear.. here's an updated version of it.

on *:TEXT:*!Remember*:#jtekbot: {
/write remember.txt $replace($1,:, )
}
on *:TEXT:*Player*left the game*:#jtekbot: {
if !$read(remember.txt) { halt }
msg $chan !page $read(remember.txt,$1) A spot is open in JTeKSvR02 quick! join!
}

Just the deleting and reading the file.

Joined: Dec 2002
Posts: 1,527
_
Hoopy frood
Offline
Hoopy frood
_
Joined: Dec 2002
Posts: 1,527
if your trying to remove the name like u say u are ...... why dont u had\ve a write -dl[N] in there to remove it after a while ....... also i dont know why u wont go with variable ..... it works the same way and is just alil faster ..... or u could go to hashtables ... which again is even faster also u have a halt in the middle of your script there that i cant see why u expect it go go on when ur halting it mid script also???


D3m0nnet.com
Joined: Dec 2002
Posts: 332
C
Fjord artisan
Offline
Fjord artisan
C
Joined: Dec 2002
Posts: 332
smething along the lines of
/write -dl5 c:\info.txt

-d is for delete and l5 is the line number

you will need a way to stor the line number or you will have to scan the file for the line beginning with the nick you want to remove
something like //echo $read(help.txt, w, *help*)

you could perhaps use the $readn identifier which would give you the last line called using the $read but i am guessing that wuldnt work because you might write 3 names before you need to remove 1 ?


Link Copied to Clipboard