mIRC Home    About    Download    Register    News    Help

Page 1 of 2 1 2 >
Topic Options
#129466 - 06/09/05 07:42 PM Problem with script
SalCro Offline
Ameglian cow

Registered: 06/09/05
Posts: 21
Hello,

i recently made a Bot
Yesterday i added something when i type !botoff the bot deops himself bot it reacts to my nickname

Code:
on *:text:!botoff*:#gameaddict: {
if ($me isop #) && ($nick == SalCro^) && ($nick isop #) {
/mode $chan -o $me
else ($nick != SalCro^) { HALT }
}
}


Can't i replace nick into something like this SalCro@salcro.users.quakenet.org

else if someone changes his nick to SalCro^he can operate my bot


grtz
thx in advence Kev.

Top
#129467 - 06/09/05 07:50 PM Re: Problem with script
Im2good4u Offline
Vogon poet

Registered: 06/09/05
Posts: 116
Loc: Amersfoort
u can $address identifir hold the adress on the user who started that textmessage

so do a if ($adress == youradress) [

to get your adress do a echo no your own adress or something laugh

Top
#129468 - 06/09/05 07:51 PM Re: Problem with script
SalCro Offline
Ameglian cow

Registered: 06/09/05
Posts: 21
So how do i have to type my adress

*!*nickname@*.users.quakenet.org like this or ????

plz help thx

Top
#129469 - 06/09/05 07:57 PM Re: Problem with script
Im2good4u Offline
Vogon poet

Registered: 06/09/05
Posts: 116
Loc: Amersfoort
yes

if ($adress === *!*nickname@*.users.quakenet.org)
or
if ($adress isin *!*nickname@*.users.quakenet.org)

but i didnt test it whit wildcats yet i think that only works whit the isin funtion


Edited by Im2good4u (06/09/05 07:59 PM)

Top
#129470 - 06/09/05 08:07 PM Re: Problem with script
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
It's $address, not $adress.

Code:
on *:text:!botoff:#gameaddict: { 
  if ($me isop $chan) && ($address($nick,5) == SalCro^!SalCro@salcro.users.quakenet.org) && ($nick isop $chan) {
    mode $chan -o $me 
  }
}


This will do what you want and only work when you're logged in on quakenet and if you keep your nick/ident the same as you mentioned. If you want it to work with any nick or with any ident or something else, just ask.

Note that you don't need to halt something if you there's nothing left to do in the script. If the IF statement fails, there's nothing to do, so it's already halted.

Also, please put any scripts into [[b][/b]code] tags so that we can see it more easily. smile

EDIT: Btw, I removed the * at the end of your !botoff trigger because * is only going to be needed if you want the trigger to work with additional information. From what code you have here, it looks as though you're only using !botoff and nothing else (not something like !botoff 10 to turn it off in 10 seconds or minutes).

Just as another comment... You may want to consider changing this into a command that works only in query or chat rather than in channel. Bot commands that are available only to ops should usually not be seen by everyone. If people don't know you have a command to do something, they can't attempt to bypass it.

Our bot is controlled only via DCC Chat (logged in with passwords) and via our keyed op channel. No user can see when we use commands that are for ops only.

Anyhow, you may not care about that. I just thought I'd mention it for you.


Edited by Riamus2 (06/09/05 08:21 PM)
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#129471 - 06/09/05 08:11 PM Re: Problem with script
Im2good4u Offline
Vogon poet

Registered: 06/09/05
Posts: 116
Loc: Amersfoort
yeh yeh i got so a lot of scripting XP im just new to this forum

Top
#129472 - 06/09/05 08:15 PM Re: Problem with script
SalCro Offline
Ameglian cow

Registered: 06/09/05
Posts: 21
ok, thx

one more question what does $nick,5 mean ?

Top
#129473 - 06/09/05 08:24 PM Re: Problem with script
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
$address($nick,5) will display the FULL $address. Actually, you could just use $fulladdress for this... I just like using $address in case I ever decide to change the type.

$address($nick,5) uses nick!ident@host

whereas $address($nick,2) would be the typical ban mask that people use -> *!*@host

Type /help $address and click the first option, then page down one page and you'll see all the $address mask types.

Btw, read the end of my previous message... I edited it but you replied before I finished.

You can check your own $address information by using it like this:

//echo -a $address($me,5)

Just replace the 5 with the different numbers.


Edited by Riamus2 (06/09/05 08:27 PM)
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#129474 - 06/09/05 08:28 PM Re: Problem with script
SalCro Offline
Ameglian cow

Registered: 06/09/05
Posts: 21
So ehh how can i make the command work for my bot and not to be shown in public

that scripts runs on my bot

so norammly it should work when SalCro^ says !botoff


Edited by SalCro (06/09/05 08:32 PM)

Top
#129475 - 06/09/05 08:29 PM Re: Problem with script
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
What doesn't work with it?

If it's just ignoring you, type //echo -a $address($me,5) and make sure that matches the IF line's address that I put for you.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#129476 - 06/09/05 08:32 PM Re: Problem with script
UOnur Offline
Ameglian cow

Registered: 14/07/05
Posts: 25
if IAL is off,$address doesn't work...

you can use $fulladdress

$fulladdress = $address(nick,5) = Nick's full adress.

Top
#129477 - 06/09/05 08:35 PM Re: Problem with script
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
Yes, I mentioned $fulladdress. I didn't realize that about IAL, though that makes sense. I think that for people who use scripts, they should have it on... makes things much easier.

I am curious, however, as to why $fulladdress would work with IAL off if $address doesn't. Oh well. smile
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#129478 - 06/09/05 08:35 PM Re: Problem with script
SalCro Offline
Ameglian cow

Registered: 06/09/05
Posts: 21
so now i have

Code:
on *:text:!botoff:#gameaddict: { 

  if ($me isop $chan) && ($fulladress == SalCro^!~salcro@SalCro.users.quakenet.org) && ($nick isop $chan) {

    mode $chan -o $me 

  }

}


No reaction .... doesn't work, i'm sorry blush

Top
#129479 - 06/09/05 08:40 PM Re: Problem with script
UOnur Offline
Ameglian cow

Registered: 14/07/05
Posts: 25
it $fulladdress, not $fulladress...

yes Riamus.that's right wink


Edited by UOnur (06/09/05 08:41 PM)

Top
#129480 - 06/09/05 08:43 PM Re: Problem with script
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
As mentioned, two d's in address. That may be part of the reason the original code wasn't working for you if you didn't put 2 in there either.

Also, your example you put of your current code shows ~ in your ident. Do you have your IDENTD turned on? In your original example of your address, you didn't display it, so I didn't include it in the code. If it's on (and working), you won't have the ~ in there, so you don't want it to be in the IF line.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#129481 - 06/09/05 08:46 PM Re: Problem with script
SalCro Offline
Ameglian cow

Registered: 06/09/05
Posts: 21
Quote:
it $fulladdress, not $fulladress...



LOL omfg sorry :tongue: i'm from belgium ... sometimes i forget some english letters ^^

but isn't ($address($nick,1) == *!*salcro@SalCro.users.quakenet.org easier ?



Edited by SalCro (06/09/05 08:48 PM)

Top
#129482 - 06/09/05 08:50 PM Re: Problem with script
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
You can use $address($nick,1) if you choose. Using 5 (or $fulladdress) allows for greater security. Of course, since you're logging into quakenet, you're probably pretty secure regardless. It's up to you, which one you choose. Find a mask you like and use it. laugh
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#129483 - 06/09/05 08:54 PM Re: Problem with script
SalCro Offline
Ameglian cow

Registered: 06/09/05
Posts: 21
ok, thx for the help dude laugh

now my last question ...
I want to !botoff without all the rest seeing it ... what should i do ?

Top
#129484 - 06/09/05 09:09 PM Re: Problem with script
Riamus2 Offline
Planetary brain

Registered: 13/10/04
Posts: 8327
Loc: MA, USA
As I mentioned above, you can use it in query or in DCC Chat rather than the channel.

For Query (private message entry):

Change to:
Code:
on *:text:!botoff:?: {
  if ($me isop #gameaddict) && ($fulladdress == SalCro^!~salcro@SalCro.users.quakenet.org) && ($nick isop #gameaddict) {
    mode #gameaddict -o $me
  }
}


For DCC Chat:
Code:
on *:chat:!botoff: {
  if ($me isop #gameaddict) && ($fulladdress == SalCro^!~salcro@SalCro.users.quakenet.org) && ($nick isop #gameaddict) {
    mode #gameaddict -o $me
  }
}


You could use either code or both codes. You could even use all 3. It's up to you.
_________________________
Invision Support
#Invision on irc.irchighway.net

Top
#129485 - 06/09/05 09:23 PM Re: Problem with script
SalCro Offline
Ameglian cow

Registered: 06/09/05
Posts: 21
i used the ?

now is i just type in the chat !botoff nothing happens do i have to type /msg !botoff ?

Top
Page 1 of 2 1 2 >