mIRC Home    About    Download    Register    News    Help

Print Thread
Page 2 of 2 1 2
#98764 26/09/04 04:58 PM
Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
if (%var == 1) { echo -a do this }
else echo -a do that

the %var is set to 1 .. then u halted ur script.. but if set to 2, then it shouldent halt..

#98765 26/09/04 05:02 PM
N
NoPleX
NoPleX
N
oh okay... Thanks smile

So now my script looks like this:

Code:
on *:TEXT:!request*:#channel:{
  if ($2 == $me) && ($left($3,1) == $chr(35)) {
    join $3
    set $+(%,req,$3) $nick
  }
}

on me:*:INPUT:#:{
  if ($1 == /j) || ($1 == /join) || ($1 == /hop) {
    set %var 1
  }
  elseif ($1 == /part) {
    set %var 2
  }
}

*raw 366:*:{
  if (%var == 1) || %var == 2) { goto end }
  elseif ($nick !isop $2) {
    .timer 1 3 part $2
    .timer 1 5 msg $eval($+(%,req,$2),2) You are not opped on channel $2 try again when you have op.
  }
  elseif ($nick($2,0) < 5) {
    .timer 1 3 .msg $eval($+(%,req,$2),2) Request failed. You do not have the required amount of users in channel.
    .timer 1 5 .part $2
  }
  else timer 1 3 .msg $eval($+(%,req,$2),2) Your channel meets the requirements and I will stay. Remember give me op or else my commands wont work.
  unset $+(%,req,$2)
  :end
}


Is there anyone there can spot errors?

#98766 26/09/04 05:29 PM
Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
why dont u just try it? then u notice if its any problem

#98767 26/09/04 05:43 PM
N
NoPleX
NoPleX
N
Code:
raw 366:*:{
  if (%var == 1) || %var == 2) { goto end }
  [color:red]elseif ($nick !isop $2) {
    .timer 1 3 part $2
    .timer 1 5 msg $eval($+(%,req,$2),2) You are not opped on channel $2 try again when you have op.
  }
  elseif ($nick($2,0) < 5) {
    .timer 1 3 .msg $eval($+(%,req,$2),2) Request failed. You do not have the required amount of users in channel.
    .timer 1 5 .part $2
  }
  else timer 1 3 .msg $eval($+(%,req,$2),2) Your channel meets the requirements and I will stay. Remember give me op or else my commands wont work.
  unset $+(%,req,$2)
  :end
}[/color]



Text marked with red doesnt work.

#98768 26/09/04 05:46 PM
T
tidy_trax
tidy_trax
T
There is no $nick in raw events.

#98769 26/09/04 05:49 PM
D
Danthemandoo
Danthemandoo
D
why not instead of messing around with the RAW, just do a 5 second timer on join to call an alias which uses $nick(#channelname,0)

#98770 26/09/04 05:54 PM
L
LocutusofBorg
LocutusofBorg
L
because

a] the raw evenm works fine as it was. It does as he asked. He'll just need to modify it a bit, like in the raw event, check if the variable $+(%,req,$2) exists before doing anything else. that should take care of both the /hop and the /join problem

b] timers are notoriously unreliable in all matters that deal with joining channels, services of any kind of automated system that could be lagged, but whose response is absolutely necessary for the script. In such cases, in good scripting, one never uses a timer, but always an event triggered by the response.


Code:
on *:TEXT:!request*:#channelname: {
  if ($2 == $me) && ($left($3,1) == $chr(35)) { join $3 | set $+(%,req,$3) $nick }
}
 
[color:blue] [/color]
raw 366:*: {
  [color:blue]if ($+(!%,req,$2)) halt[/color]
  [color:red]if ($eval($+(%,req,$2),2) !isop $2) {
    .msg $eval($+(%,req,$2),2) Request failed. You are not opped on channel $2 try again when you have op.
    .part $2
  }[/color]
  elseif ($nick($2,0) < 5) {
    .msg $eval($+(%,req,$2),2) Request failed. You do not have the required amount of users in channel.
    .part $2
  }
  else .msg $eval($+(%,req,$2),2) Your channel meets the requirements and I will stay. Remember give me op or else my commands wont work.
  unset $+(%,req,$2)
}


The blue line is added to my original code to prevent the raw event from triggering if you do a /hop or manual /join or any other kind of join that was not triggered by the script. This could still malfunction if you do a join or hop while the script is processing the !request command by a user, but odds of that happening are kinda astronomical.

The part in red is added to check if the requester is an op in the channel.

#98771 26/09/04 06:29 PM
N
NoPleX
NoPleX
N
LocutusofBorg i am using your script. But the:
Code:
  if ($eval($+(%,req,$2),2) !isop $2) {
    .msg $eval($+(%,req,$2),2) Request failed. You are not opped on $2 try again when you have op.
    .part $2
  }
  elseif ($nick($2,0) < 5) {
    .msg $eval($+(%,req,$2),2) Request failed. You do not have the required amount of users in channel.
    .part $2
  }
  else .msg $eval($+(%,req,$2),2) Your channel meets the requirements and I will stay. Remember give me op or else my commands wont work.
  unset $+(%,req,$2)
}


That part still seams like it wont trigger confused

#98772 26/09/04 06:47 PM
L
LocutusofBorg
LocutusofBorg
L
I tested it before posting - it works fine. Just remember YOU cannot trigger it.

Try this tho:

Code:
on *:TEXT:!request*:#channelname: {
  if ($2 == $me) && ($left($3,1) == $chr(35)) { join $3 | set $+(%,req,$3) $nick }
}
 [color:red] [/color]
raw 366:*: {
  if ($+(%,req,$2)) {
    if ($eval($+(%,req,$2),2) !isop $2) {
      .msg $eval($+(%,req,$2),2) Request failed. You are not opped on channel $2 try again when you have op.
      .part $2
    }
    elseif ($nick($2,0) < 5) {
      .msg $eval($+(%,req,$2),2) Request failed. You do not have the required amount of users in channel.
      .part $2
    }
    else .msg $eval($+(%,req,$2),2) Your channel meets the requirements and I will stay. Remember give me op or else my commands wont work.
    unset $+(%,req,$2)
  }
}

#98773 26/09/04 06:51 PM
N
NoPleX
NoPleX
N
Okay. Thats wierd crazy

i got 2 mirc installed. I go to a channel with one of them where im opped but only one user. Then i use !request <botname> #channel and then it joins but doenst part. confused

#98774 26/09/04 07:08 PM
N
NoPleX
NoPleX
N
Okay now it works. But now we have the old /hop /join /j problem back. crazy

#98775 26/09/04 07:47 PM
Joined: Feb 2003
Posts: 3,412
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,412
if ($1 == /hop) %% (%var == 2) { set %var 1 }

#98776 27/09/04 05:28 AM
L
LocutusofBorg
LocutusofBorg
L
Have someone triger the script. See if the variable still exists after awhile. it shouldn't.

Page 2 of 2 1 2

Link Copied to Clipboard