mIRC Homepage
Posted By: SalCro Problem with script - 06/09/05 06:42 PM
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.
Posted By: Im2good4u Re: Problem with script - 06/09/05 06:50 PM
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
Posted By: SalCro Re: Problem with script - 06/09/05 06:51 PM
So how do i have to type my adress

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

plz help thx
Posted By: Im2good4u Re: Problem with script - 06/09/05 06:57 PM
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
Posted By: Riamus2 Re: Problem with script - 06/09/05 07:07 PM
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.
Posted By: Im2good4u Re: Problem with script - 06/09/05 07:11 PM
yeh yeh i got so a lot of scripting XP im just new to this forum
Posted By: SalCro Re: Problem with script - 06/09/05 07:15 PM
ok, thx

one more question what does $nick,5 mean ?
Posted By: Riamus2 Re: Problem with script - 06/09/05 07:24 PM
$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.
Posted By: SalCro Re: Problem with script - 06/09/05 07:28 PM
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
Posted By: Riamus2 Re: Problem with script - 06/09/05 07:29 PM
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.
Posted By: UOnur Re: Problem with script - 06/09/05 07:32 PM
if IAL is off,$address doesn't work...

you can use $fulladdress

$fulladdress = $address(nick,5) = Nick's full adress.
Posted By: Riamus2 Re: Problem with script - 06/09/05 07:35 PM
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
Posted By: SalCro Re: Problem with script - 06/09/05 07:35 PM
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
Posted By: UOnur Re: Problem with script - 06/09/05 07:40 PM
it $fulladdress, not $fulladress...

yes Riamus.that's right wink
Posted By: Riamus2 Re: Problem with script - 06/09/05 07:43 PM
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.
Posted By: SalCro Re: Problem with script - 06/09/05 07:46 PM
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 ?

Posted By: Riamus2 Re: Problem with script - 06/09/05 07:50 PM
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
Posted By: SalCro Re: Problem with script - 06/09/05 07:54 PM
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 ?
Posted By: Riamus2 Re: Problem with script - 06/09/05 08:09 PM
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.
Posted By: SalCro Re: Problem with script - 06/09/05 08:23 PM
i used the ?

now is i just type in the chat !botoff nothing happens do i have to type /msg !botoff ?
Posted By: Im2good4u Re: Problem with script - 06/09/05 08:31 PM
make the ? a #
Posted By: Riamus2 Re: Problem with script - 06/09/05 08:37 PM
No. He wants it NOT in the channel.

If you used the query one, like you said, then either open a query window to the bot and type !botoff, or else in the channel, type /msg botnick !botoff

*Replace "botnick" with your bot's nick.
Posted By: Im2good4u Re: Problem with script - 06/09/05 08:48 PM
Oops oke :tongue:
Posted By: SalCro Re: Problem with script - 07/09/05 05:27 PM
i have another problem, if i type !boton my bot needs to activate again (get opped)

normally when he is in L auto op and stuff this should work

chanserv # op $me

but it doesnt, it says CHANSERV unkniow command
Posted By: Im2good4u Re: Problem with script - 07/09/05 05:32 PM
/msg chanserv # op $me

maybe :tongue:
Posted By: SalCro Re: Problem with script - 07/09/05 06:01 PM
Nope, because u need to give a nick then
Posted By: Riamus2 Re: Problem with script - 07/09/05 06:35 PM
What do you mean, you have to give a nick? Chanserv IS a nick. smile
Posted By: SalCro Re: Problem with script - 07/09/05 06:42 PM
How do i have to op myself when i am deopped

chanserv # op $me ???

if i do msg chanserv it says chanserve no such nick
Posted By: Riamus2 Re: Problem with script - 07/09/05 06:49 PM
Do you HAVE a chanserv service on your network? Not all networks have Chanserv.... they have other services or no services.

If there is something other than chanserv, then you need to use the commands for that instead.
Posted By: SalCro Re: Problem with script - 07/09/05 06:56 PM
My channel is on Quakenet
Posted By: Riamus2 Re: Problem with script - 07/09/05 07:08 PM
I don't use Quakenet, so I have no idea if they have Chanserv. Do they? Or is it something else? If you're not sure, ask in #help on there. It sounds like they don't.
Posted By: Im2good4u Re: Problem with script - 07/09/05 07:09 PM
there is no chanserv there

u need to get an L

thne the comand is

/msg L op #

but your bot must already be authed whit L then

for more info do /msg L help

or goto Qnet website
Posted By: Riamus2 Re: Problem with script - 07/09/05 07:15 PM
So, in that case, when the !boton trigger is done, the bot should authorize itself with L and then ask L to op it using the appropriate commands for both.
Posted By: Im2good4u Re: Problem with script - 07/09/05 07:17 PM
witch are

/msg Q@CServe.quakenet.org AUTH yourauthnick yourpassword
/msg l op #

(Q and L) work on same auth database laugh
© mIRC Discussion Forums