mIRC Home    About    Download    Register    News    Help

Print Thread
#108072 16/01/05 12:45 PM
Joined: Sep 2004
Posts: 237
J
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Sep 2004
Posts: 237
I'm grabbing raws for topic and setting them as variables. I then compare the variables to a text file and write if not already there. Problem is if i join several channels at once.
This is pretty much how i'm doing it.
Code:
 on *:JOIN:*: {
  if ($nick == $me) goto Twrite
  :Twrite
  .set %T3 %T1 %T2
  if $read(Topic.txt,nw,%T3) { Halt }
  else { /write -i Topic.txt %T3 }
}
raw 332:*: set %T2 To: $3- 
raw 333:*: set %T1 $+($2 Topic was set by $3 on $Date(ddd. mmm. dd yyyy))  

Works fine if i join 1 channel, but doesnt when i join several. Any ideas what i might do to get around this?

#108073 16/01/05 01:11 PM
Joined: Dec 2002
Posts: 3,534
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Dec 2002
Posts: 3,534
This works fine for me, I joined 5 channels at a time and wrote to topic.txt.

Course I used:

//join #chan1 | join #chan2 | join #chan3 | join #chan4 | join #chan5.

No problems here.

#108074 16/01/05 01:20 PM
Joined: Nov 2003
Posts: 2,321
T
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,321
Code:
raw 332:*:{ set %T2 To: $3- } 
raw 333:*:{ 
  if (!$read(topics.txt,nw,$+($2 Topic was set by $3 on $Date(ddd. mmm. dd yyyy)) %T2)) { write topics.txt $+($2 Topic was set by $3 on $Date(ddd. mmm. dd yyyy)) %T2 }
}

#108075 16/01/05 01:45 PM
Joined: Sep 2004
Posts: 237
J
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Sep 2004
Posts: 237
Didnt work for me tidy_trax, but that is a damned good idea.
Slade, it grabs 2 channel topics ok , but when i look at the variables it has the info i want , just hasnt combined it and wrote it. ( %T1 and %T2 have the right info for the third chan , but %T3 is still set for the second channel. Like its lagging. ( I use autojoin from the favorites list. )


EDIT: Errrr....... found out why it wasnt working for me .... wasnt giving it enough time.... any way to prevent it from opening till all Topics have been evaluated and delt with?

Last edited by JAFO; 16/01/05 01:51 PM.
#108076 16/01/05 02:15 PM
I
Iori
Iori
I
Code:
raw 332:*:set %T2 To: $3-
raw 333:*:{
  var %T1 = $2 Topic was set by $3 on $Date([color:red]$4[/color],ddd. mmm. dd yyyy) %T2
  write $+(-w",%T1,") topic.txt %T1
  unset %T2
}

Last edited by Iori; 16/01/05 02:17 PM.
#108077 16/01/05 02:35 PM
Joined: Sep 2004
Posts: 237
J
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Sep 2004
Posts: 237
Perfect , thanks for all the help guys.


And if youre reading this Chris........ mine all mine , I asked for the help so dont go stealin it. :tongue:

#108078 16/01/05 11:01 PM
D
DaveC
DaveC
D
omg Iori hes copyrighted your code on you, you can never use it again smile

#108079 17/01/05 12:08 AM
I
Iori
Iori
I
Yikes! Good thing I have no interest in storing piles of topics. grin


BTW Jafo
The reason your code didn't work properly is because the JOIN event occurs before the two raws are recieved.
1st Join event:-> nothing to write yet
1st raw 332:-> set %T1
1st raw 333:-> set %T2
2nd Join event:-> writes the vars from the first set

2nd raw 332:-> reset %T1
2nd raw 333:-> reset %T2
3rd Join event:-> writes the vars from the second set

3rd raw 332:-> reset %T1
3rd raw 333:-> reset %T2
^^ The last won't be written (unless|until you join another channel)

#108080 17/01/05 02:10 PM
Joined: Sep 2004
Posts: 237
J
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Sep 2004
Posts: 237
Oh, well that makes sense ...... And FYI.. we just do these little things as a teaching aid, best way to learn is by doing. (And getting as much help from you guys as possible! ) :tongue:

EDIT: Any ideas how to grab those raws other than with the on join ..... I wouldnt think rawmode would do it, right.

Last edited by JAFO; 17/01/05 02:13 PM.
#108081 17/01/05 09:28 PM
Joined: Sep 2004
Posts: 237
J
JAFO Offline OP
Fjord artisan
OP Offline
Fjord artisan
J
Joined: Sep 2004
Posts: 237
Ignore previous, you already told me how to get around it.


Link Copied to Clipboard