mIRC Home    About    Download    Register    News    Help

Print Thread
#240653 20/02/13 04:45 AM
Joined: Feb 2013
Posts: 8
F
Fraibi Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2013
Posts: 8
I want to Operate my Bot By Giving Commands in Private. Please if Any1 Can Help me.


Waiting.

Joined: Mar 2004
Posts: 526
Fjord artisan
Offline
Fjord artisan
Joined: Mar 2004
Posts: 526
there are many ways to do this.. but basics..

on the bot setup a script to use ON text (for message) or ctcp event to catch the special string you send to the bot to op it..
then on you id you would either message the bot with the text the bot would act upont . or if ctcp you would /ctcp botname special_keword to process the ops request..

ie /ctcp mybot OPUP

on the bot, when it gets the ctcp (or mesage), it would issue the command to sevices to op itself..

see /help on text and /help ctcp for more info.


Help others! It makes the world a better place, Makes you feel good, and makes you Healthy!
Joined: Feb 2013
Posts: 8
F
Fraibi Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2013
Posts: 8
Yaar i want some script like how it will be written? if u can give me any sample script?

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Does it just need to work in one specific channel or all common channels you have with the bot?

Joined: Feb 2013
Posts: 8
F
Fraibi Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2013
Posts: 8
In All Channels. I just want this that if u give my Bot Command !kick Nick Or !ban 12.22.22.* . Bot perform tht command.

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
So if you say "!kick Nick" you want it to kick Nick in all channels that the bot is OP in and Nick is in?

Joined: Feb 2013
Posts: 8
F
Fraibi Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2013
Posts: 8
Yup. But this command will be in Private of BOT . No On MAIN of Channel

Last edited by Fraibi; 22/02/13 06:37 AM.
Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
You should have a password or somthing that protect the commands, and also make a check so people cant do a !ban *!*@*, this will ban all users in the channel.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Code:
on master:TEXT:!kick *:?:{
  var %i = 1
  while ($comchan($nick,%i)) {
    if ($me isop $v1) && ($2 ison $v2) { kick $v2 $2- }
    inc %i
  }
}


Then just add people to your master user level by using /auser master <nick/address>

Joined: Feb 2013
Posts: 8
F
Fraibi Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2013
Posts: 8
its not working. frown

i have added dis scrip in remotes and added nick at master level. but not accepting tha command

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Did you use

/auser master <nick or address> (without the < >)

A note is that you will not trigger a on text event your self, somone else in the channel need to type the command. And last, make shure you dont have any other on text events abow the text event you want to trigger.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Feb 2013
Posts: 8
F
Fraibi Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2013
Posts: 8
yes

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
Start debug on your bot, then maybe you see if it is a problem.

/debug @debug . When @debug window is open, try type the command to the bot, then maybe you spot the problem, maybe so simple it sends the wrong command to the server.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Feb 2013
Posts: 8
F
Fraibi Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2013
Posts: 8
Let me give u example Script.

on 500:text:!kick*:#:{ /kick $chan $2 4Reason:12 $3- }

By adding above mentioned line. if we gave this command on MAIN of channel . Bot kicks the person. but i want this that if i give this command in p2p/privte of bot. then bot should kick the person like

/msg bot !kick Alferd Be Nice and bot should kick the person with readon benice


waiting for response

Joined: Feb 2003
Posts: 3,432
S
Hoopy frood
Offline
Hoopy frood
S
Joined: Feb 2003
Posts: 3,432
$chan will not return the channel name if it is in private.

$1 = !kick -> $2 = Alfred -> $3- = Be Nice and bot should kick the person with readon benice

So you need to get the user to write the chanel. Or you need to enter the channel your self.

$1 = !kick -> $2 = #channel -> $3 = Alfred -> $4- = kick reason.

or
on 500:text:!kick*:?:{ /kick #channel $3 4Reason:12 $4- }

Notice the ? sign instead of # sign.


if ($me != tired) { return } | else { echo -a Get a pot of coffee now $+($me,.) }
Joined: Oct 2012
Posts: 164
D
Vogon poet
Offline
Vogon poet
D
Joined: Oct 2012
Posts: 164
Or if you just want the bot to kick the nick from any channel it is opped on, loop through $comchan()

Code:
on 500:text:!kick *:?:{
  var %i = 1
  while ($comchan($2,%i)) {
    if ($me isop $v1) { kick $v2 $2 4Reason:12 $3- }
    inc %i
 }
}


Joined: Feb 2013
Posts: 8
F
Fraibi Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2013
Posts: 8
Mr. Deega & Sparta

Much Appreciation for your efforts but i think i am unable to clear what i want. let me tell you guyz again.
This command "on 500:text:!kick*:#:{ /kick $chan $2 4Reason:12 $3- }"works perfectly if i give command on MAIN of channel e.g !kick Alferd behave it kicks the alferd. But it dosent work if i give command in notice/private of bot. it works only on MAIN of channel.


Now i want you guyz to modify it like if i give same command in Private/Notice of bot . e.g. /notice bot !kick Alferd Behave. then bot should kick alferd.

Thanks u in advance

Joined: Sep 2005
Posts: 2,881
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Sep 2005
Posts: 2,881
Deega's script DOES work in private, as does mine above. The '?' in the target parameter indicates it reacts when a private message is received.

Mine will kick the specified person from all channels you share with the person issuing the command, whereas Deega's will kick the specified person from all channels you share with the person being kicked.

If it's still not working for you, I suggest you try putting it into a new script in the script editor, as there may be other events in the script file you're putting it in that are preventing this one from firing.


Link Copied to Clipboard