mIRC Home    About    Download    Register    News    Help

Print Thread
#108720 21/01/05 10:32 PM
S
severnaya
severnaya
S
I am trying to modify a remote script, but I couldn't see for sure from the help files..
the code-part I want to add to is from YourBot (mboard.mrc):
Code:
on 1:TEXT:*mview*:*: { 
  if ($1 == %qc $+ mview) { 
    if ($lines(txt\mbmessages.txt) == 0) { .msg $nick 5There are currently no entries to view. | closemsg $nick | halt }
    else { .play $nick txt\mbmessages.txt 1500 | closemsg $nick | halt }
  }
  else { halt }
}


.... I would like that code to run iff $nick is on channel #test.
how should I do this using ison?
thanks!

Last edited by severnaya; 21/01/05 10:32 PM.
#108721 21/01/05 10:34 PM
Joined: Mar 2004
Posts: 457
D
Fjord artisan
Offline
Fjord artisan
D
Joined: Mar 2004
Posts: 457
if (nick ison #channel) {

you must be on the channel you specify for it to work.

#108722 21/01/05 10:36 PM
S
severnaya
severnaya
S
ok but what for the case when they are not on the channel?
will it just automatically return?
thanx

#108723 21/01/05 11:37 PM
S
severnaya
severnaya
S
ok I have it working, however can I use ISVOICE anywhere?
this works in the channel, so someone types 'test' and only if they are voiced will the code execute:
Code:
on 1:text:*test*:#: {
 if ($nick isvoice #test) {
;stuff


but this does not: (the user PM's with the text 'view', but even if they are not voiced in the channel, the code is still executed frown
(I do have halt statements also, btw)

Code:
on 1:TEXT:*view*:*: {
 if ($nick isvoice #test) { 
;stuff


why?
thanks

#108724 21/01/05 11:43 PM
D
DaveC
DaveC
D
Code:
on 1:TEXT:*mview*:*: {
  if (($1 == %qc $+ mview) && ($nick ison #test)) { 
    if ($lines(txt\mbmessages.txt) == 0) { .msg $nick 5There are currently no entries to view. | closemsg $nick }
    else { .play $nick txt\mbmessages.txt 1500 | closemsg $nick }
  }
}


you need to be on #test as well, and if there not it dont do anything.

I removed the halts as there not needed. since the script was gonna halt anyway after each one of them anyway smile

whats %qc ? is it soemthing that changes, if not it could be in the ON TEXT, actually it could be anyway, but i just wondered if it was soemthing you didnt think u could add like a : or an actual * or something

#108725 21/01/05 11:50 PM
S
severnaya
severnaya
S
smile thanks
I will that and some variations u mentioned
not sure what the %qc variable is, this is part of a much bigger bot script - i think it is a trigger character maybe

#108726 21/01/05 11:54 PM
D
DaveC
DaveC
D
oh fair enough, in that case dont muck with it
maybe even leave the halts in

If your editing a bot then try and minimize your alterations

Oh and the isvoice works fine for me here, either if they say in channel or PM, if there not voiced then it dont work.

#108727 22/01/05 12:14 AM
S
severnaya
severnaya
S
this is really strange, it does not work..
i tried unvoiced in the chan and it worked, and I tried even outside the chan and it worked
however, in the bot - you type: /msg bot .mview (with a dot as a trigger)
could this be affecting it?
thanks!

#108728 22/01/05 01:35 AM
D
DaveC
DaveC
D
i dont see why it would.

One thing, add some ECHO's to the event, make sure the event is actually being triggered, and that its not another event doing something, and u just think its that one.

#108729 22/01/05 01:43 AM
S
severnaya
severnaya
S
ok have a look at the code... when I am outside the channel and I private message with view, it still executes - but clearly I am not voiced!
I tried with ISON as well and the same thing happened!

there is only one .play and it is here, so it must be being executed
Code:
on 1:text:*view*:?: {
 if ($nick isvoice #test) { 
  if ($1 == %qc $+ view) { 
    if ($lines(txt\mbmessages.txt) == 0) { .msg $nick 5There are currently no entries to view. | closemsg $nick | halt }
    else { .play $nick txt\mbmessages.txt 1500 | closemsg $nick | halt }
  }
  else { halt }
 }
else { halt }
}


thanks

#108730 22/01/05 03:37 AM
D
DaveC
DaveC
D
Code:
on 1:text:*view*:?: {
 if ($nick isvoice #test) {

  echo -st XXXX CHECKPOINT1 XXXX msg with *view* in it and user $nick is voiced in #test | halt 
 
  if ($1 == %qc $+ view) { 
    if ($lines(txt\mbmessages.txt) == 0) { .msg $nick 5There are currently no entries to view. | closemsg $nick | halt }
    else { .play $nick txt\mbmessages.txt 1500 | closemsg $nick | halt }
  }
  else { halt }
 }
 else { halt }
}


Replace with this, i cant get it to occur unless the user is voiced, at least this well confirm if its this code or something else tripping, note the HALT you can remove that or leave it in, I had it as the rest of the code needed the %qc and the text file.


Link Copied to Clipboard