mIRC Home    About    Download    Register    News    Help

Print Thread
#190681 24/11/07 09:42 AM
Joined: Jul 2007
Posts: 32
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Jul 2007
Posts: 32
Hi, this is probably a pretty dumb question and im good with most mirc scripting but im just learning read/write and i have made a !setjoin script but for !deljoin.
Baiscally i need it to delete the users join message its probs somethin like

Code:
on *:text:!deljoin*:#: write -dl(dunno)


I think thats correct way to delete a line but how can i make it so it deletes the line i want, i could do it like -dl2 or something but that woudnt be very good if i had 50 join messages in there, it would just delete line 2 every time.

Sorry if im bad at explaining but hope someone can help smile

Joined: May 2007
Posts: 89
T
Babel fish
Offline
Babel fish
T
Joined: May 2007
Posts: 89
How are the join messages stored in the file ? What is the name of the file ?

Tell us more please. smile

For instance, if the messages are stored as this:

nick01
join message
nick02
join message
...

or as

nick01 join message
nick02 join message
...

which are, I think, two possible ways of storing 'indexed' information, then the search through the file is relatively simple to the knowledge of the w or the r option of the $read identifier. The w option makes a wildmatch on all lines of a file until it finds a match, the r option uses regular expressions to do the same.

Have a look at:

/help $read

It may help wink

Cordialement

Last edited by TropNul; 24/11/07 09:53 AM.

tropnul
TropNul #190688 24/11/07 11:22 AM
Joined: Jul 2007
Posts: 32
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Jul 2007
Posts: 32
Code:
on *:text:!setjoin*:#: {
  //write setjoin.txt [ $+ $nick $+ ] $2-
  notice $nick Setjoin saved, use !deljoin to delete you join message.
}

on *:join:#: {
  msg # $read(setjoin.txt, w, * $+ $nick $+ * $+ )
}


its just gettin save as plain text.

Joined: Apr 2006
Posts: 464
O
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
This should work:

write -dw[ $+ $nick $+ ]* setjoin.txt

Joined: Jul 2007
Posts: 32
S
Ameglian cow
OP Offline
Ameglian cow
S
Joined: Jul 2007
Posts: 32
yea its actually,

Code:
write -dlw[ $+ $nick $+ ]* setjoin.txt


thanks for your help with my dumb question wink


Link Copied to Clipboard