mIRC Homepage
Posted By: Sh4d0w191 !deljoin script - 24/11/07 09:42 AM
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
Posted By: TropNul Re: !deljoin script - 24/11/07 09:52 AM
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
Posted By: Sh4d0w191 Re: !deljoin script - 24/11/07 11:22 AM
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.
Posted By: OrionsBelt Re: !deljoin script - 24/11/07 01:52 PM
This should work:

write -dw[ $+ $nick $+ ]* setjoin.txt
Posted By: Sh4d0w191 Re: !deljoin script - 24/11/07 03:45 PM
yea its actually,

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


thanks for your help with my dumb question wink
© mIRC Discussion Forums