mIRC Home    About    Download    Register    News    Help

Print Thread
#146789 09/04/06 12:13 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
bot has like this:

on 30:text:-addblist*:#:{ do stuff }

but it triggers also if user types
-addblistblabla (anything merged with cmd)

and if i put
on 30:text:-addblist *:#:{ }
with space then it wont react at all :tongue:

any fix for such behaviour?


IceCapped
#146790 09/04/06 02:00 AM
Joined: Jun 2003
Posts: 994
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Jun 2003
Posts: 994
Code:
 on *:text:-addblist *:#: echo 12 -a $nick said $2- 


This works here in v6.17 and v6.16. Didn't try it by adding a userlevel 30, but ...


I refuse to engage in a battle of wits with an unarmed person. wink
#146791 09/04/06 02:28 AM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
on 30:text:-addblist:#:{ ... }

Is that what ya wanted? you never made it clear.

#146792 09/04/06 10:59 AM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
yeah, im sorry for louzy desc.

usage is
-addblist some_host

so it cant be just
on 30:text:-addblist:#:{ ... }

i have it
on 30:text:-addblist*:#:{ ... }
but as said it triggers on any merged word with command
like -addblistblabla

i tried then with space
on 30:text:-addblist *:#:{ ... }
and it wont trigger event 1

Code:
on 30:text:-addblist *:#:{ 
  if ($2 == $null) { .notice $nick usage: -addblist <host> (e.g. someone.quakenet.org) | halt }
  else { .writeini $scriptdir\blacklist.ini blackmark *!*@ $+ $2- 1 | .notice $nick added *!*@ $+ $2- to blacklist. | halt }
}

  


it wont trigger case 1 (when $2 is null)
but it works for case 2 though


IceCapped
#146793 09/04/06 01:40 PM
Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
If it's just going to one word following -addblist, try this...

on 30:text:-addblist &:#:{

* = any string of characters (or no character)
? = any one character
& = any one word or number

#146794 09/04/06 02:07 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
what if i have 2 or 3 words (as settings) after some trigger ?

~edit~
with & it still doesnt work with case 1

Last edited by raZOR; 09/04/06 02:09 PM.

IceCapped
#146795 09/04/06 02:26 PM
Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
Well no it won't in case 1 ...

on 30:text:-addblist &:#:{

$2 must be present or it won't trigger

on 30:text:-addblist & &:#:{

$3 must be present or it won't trigger

Maybe try this...

on 30:TEXT:-addblist:#: {
.notice $nick usage: -addblist <host> (e.g. someone.quakenet.org)
}

on 30:TEXT:-addblist &:#: {
writeini $scriptdirblacklist.ini blackmark *!*@ $+ $2- 1
.notice $nick added *!*@ $+ $2- to blacklist.
}

#146796 09/04/06 02:54 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
hmm
doesnt look too good smirk
(no disrespect to you or no offence)

i thought mirc has some ways of detecting things
in such cases :P

thanks for help ^^


IceCapped
#146797 09/04/06 03:02 PM
Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
No offense taken, but that last one worked for me,
but if you don't like it for whatever reason, then try this...

on 30:TEXT:-addblist*:#: {
if ($1 != -addblist) return
if ($2 == $null) .notice $nick usage: -addblist <host> (e.g. someone.quakenet.org)
else {
.writeini $scriptdir\blacklist.ini blackmark *!*@ $+ $2- 1
.notice $nick added *!*@ $+ $2- to blacklist.
}
}

#146798 09/04/06 03:12 PM
Joined: Dec 2004
Posts: 66
B
Babel fish
Offline
Babel fish
B
Joined: Dec 2004
Posts: 66
I have 6.16
Code:
on 1:text:-addblist *:#:{
  msg #Tes  triggered: $1-
}  


and from another instance of mirc I used this alias for test input:
Code:
/addb {
  msg #Test This is a test alias
  msg #Test -addblist some_host
  msg #Test -addblist
  msg #Test -addblistshouldn't trigger
  msg #Test -addblist some_host multi word
  msg #Test shouldn't trigger -addblist blah
}  

I got this result:
Quote:
<Bob> This is a test alias
<Bob> -addblist some_host
> triggered: -addblist some_host
<Bob> -addblist
<Bob> -addblistshouldn't trigger
<Bob> -addblist some_host multi word
> triggered: -addblist some_host multi word
<Bob> shouldn't trigger -addblist blah

Isn't that behaving the way you want it to?

#146799 09/04/06 03:19 PM
Joined: Feb 2005
Posts: 681
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Feb 2005
Posts: 681
msg #Test -addblist

He wants that one to trigger as well
so he can use his if ($2 == $null) line

on 1:text:-addblist *:#: {

That should trigger even if $2 is not present.
But I guess mIRC doesn't see the space between
$1 and * as null. But if you were to try and message
-addblist with a space at the end, mIRC would strip
off the space, makes no sense.

~ Edit ~
I recall running into this problem a
few years ago so it's nothing new.

Last edited by mIRCManiac; 09/04/06 03:25 PM.
#146800 09/04/06 03:35 PM
Joined: Apr 2005
Posts: 1,009
raZOR Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Apr 2005
Posts: 1,009
hey, very nice workaround !
thanks, i like it =D


IceCapped
#146801 10/04/06 07:44 PM
Joined: Sep 2003
Posts: 4,230
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Sep 2003
Posts: 4,230
I get ya now, you want to catch it with or without a $2, it can be done with regex but not with out them (well not without a lot of screwing around that just isnt worth it)

Try this, its simple and readable.

on 30:text:-addblist *:#:{ .writeini $scriptdir\blacklist.ini blackmark *!*@ $+ $2- 1 | .notice $nick added *!*@ $+ $2- to blacklist. }
on 30:text:-addblist:#:{ .notice $nick usage: -addblist <host> (e.g. someone.quakenet.org) }

1st one gets anything with a $2
2nd one gets anything without


Link Copied to Clipboard