mIRC Homepage
Posted By: woof Help with variables. - 15/12/07 09:58 AM
I made a short script, but it didnt work, I wanted it so when someone types .rape meow
The bot would respond accordingly,

Test: .rape meow
Bot: This may hurt a little ...
Bot: /me rams a huge dildo in and out of meow

I want it so 'meow' or 'nick' can be anyone, i've never got it to work, and i'm not excellent at variables.
Posted By: TropNul Re: Help with variables. - 15/12/07 10:44 AM
Something like this would do it.

Code:
; Declaring an 'on text' event matching on a [i]regular expression[/i]. \S+ is the nickname entered and is captured in $regml(2).
On $*:Text:/^(\.rape\s(\S+))$/Si:#channelname:{

  ; An antiflood variable is verified if inexistant here
  If !%isbusy {
    
    ; Verifying if the $2 entered is really a nickname on the channel where the event took place.
    If ($regml(2) isreg #) {

      ; Messaging 2 delayed messages now ...
      .Timer 1 1 MSG # This may hurt a little...
      .Timer 1 3 Describe # rams a huge dildo in and out of $regml(2)
      
      ; Setting the %isbusy antiflood variable to 'active' status.
      ; Whilst this variable will exist, the bot will not reply to anyone. The -z5 switch makes that it will active for 5 seconds before unsetting itself.
      Set -z5 %isbusy processing already...
    }

    ; This need no explanation
    Else { .Timer 1 1 Notice $nick $2 not found on # }
  }
  
  ; This also need no explanation :)
  Else { .Timer 1 1 Notice $nick %isbusy please wait. }
}


Just modify #channelname and that's it.

Cordialement,
Posted By: woof Re: Help with variables. - 15/12/07 11:10 AM
<User04> .rape woof
-woof- woof not found on #wellofsouls
<User04> .rape meow
-woof- meow not found on #wellofsouls

I did what you said, replace channelname with my channel.

but it keeps saying those nicknames arent in the channel when they are.

Thanks.
Posted By: TropNul Re: Help with variables. - 15/12/07 11:15 AM
That's bizarre because the regexp seems to be correct.

Try again by replacing this line
Code:
If ($regml(2) isreg #) {

with
Code:
If ($2 ison #) {


If this edit functions, then it's the regexp which is at fault.
And I still can't find/explain why :s.
Posted By: woof Re: Help with variables. - 15/12/07 11:38 AM
It didn't work either, but thanks. Fixed it myself :P
© mIRC Discussion Forums