mIRC Home    About    Download    Register    News    Help

Print Thread
!deljoin script #190681 24/11/07 09:42 AM
Joined: Jul 2007
Posts: 32
S
Sh4d0w191 Offline OP
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

Re: !deljoin script [Re: Sh4d0w191] #190683 24/11/07 09:52 AM
Joined: May 2007
Posts: 89
T
TropNul Offline
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
Re: !deljoin script [Re: TropNul] #190688 24/11/07 11:22 AM
Joined: Jul 2007
Posts: 32
S
Sh4d0w191 Offline OP
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.

Re: !deljoin script [Re: Sh4d0w191] #190693 24/11/07 01:52 PM
Joined: Apr 2006
Posts: 464
O
OrionsBelt Offline
Fjord artisan
Offline
Fjord artisan
O
Joined: Apr 2006
Posts: 464
This should work:

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

Re: !deljoin script [Re: OrionsBelt] #190698 24/11/07 03:45 PM
Joined: Jul 2007
Posts: 32
S
Sh4d0w191 Offline OP
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