mIRC Homepage
Posted By: bojak71730 mybot - 10/05/06 10:36 PM
ok i have a problem made an op and deop script for my friends chatroom and well i can deop me but i cant op me using my bot heres the op and deop scripts
Code:
on *:TEXT:!op*:#:{
  if ($nick !isop $chan) { halt }
  if ($2 !ison $chan) { halt }
  mode $chan +o $2
}

and
Code:
on *:TEXT:!deop*:#:{
  if ($nick !isop $chan) { halt }
  if ($2 !ison $chan) { halt }
  mode $chan -o $2
}
Posted By: RedDevilUK Re: mybot - 10/05/06 10:50 PM
because to deop youself is just a simple command

but to OP yourself you need to be authorised by the server and/or OPed by someone else
either a person or a bot

for me to be opped in my channels on Quakenet i have to auth first... to prove its me then msg the Quaknet bot in our channel with a command

if it was as simple as your script suggests... then you would have a serious security problem.. as anyone would be able to OP the same way you do?

the same way you op manually... these commands need to be in the script
Posted By: bojak71730 Re: mybot - 10/05/06 10:52 PM
so what i could is i could make a list of people to op and the bot would me if i was on the list the thing is i made a script for an auto op but still isnt working
Posted By: bojak71730 Re: mybot - 10/05/06 10:54 PM
i have a folder on my desktop that has a copy of mirc in it and all the alaise remote and stuff in there with it i even put a copy of the bot in a text file and added it in there to make sure i never lost it i dunno if this is all a good idea but thats what i was told to do
Posted By: SladeKraven Re: mybot - 10/05/06 10:55 PM
The reason you can't op yourself using the bot is because you have made it so only opped users may use the command. And since you aren't opped you can't op yourself.
Posted By: RedDevilUK Re: mybot - 10/05/06 10:56 PM
is the bot an official bot like a server or eggbot

or is it a computer with mirc on just sitting on the channel?

if its an official bot then refer to the instructions
Posted By: bwr30060 Re: mybot - 11/05/06 12:57 AM
Isn't this line a problem?
Code:
if ($nick !isop $chan) { halt }

How is this script supposed to be used? Is the person who wants to be opped the one to type "!op"? Because that line says basically "If the person is not an op when they type "!op", halt the script."
Posted By: Othello Re: mybot - 11/05/06 01:14 AM
Nothing wrong with that code.


as for this code here is a simplified version of the same code

Code:
 
on *:TEXT:!op*:#: { 
 if ($nick !isop $chan) || ($2 !ison $chan) { halt } 
 mode $chan +o $2
}
 
Posted By: MikeChat Re: mybot - 11/05/06 03:53 AM
Quote:
Nothing wrong with that code.


yes there is, unless you have ops already you cant get ops? that makes no sense.

How can someone type text in a channel if they arent in the channel? If you dont have the channel mode set to stop that you are wide open to harrassment.

Quote:


Code:
 
on *:TEXT:!op*:#: { 
 if ($nick !isop $chan) || ($2 !ison $chan) { halt } 
 mode $chan +o $2
}
 


if you have the channel operators added to a user level, lets say 1000

on 1000:text:!op:#yourchannel:{ mode #yourchannel +o $nick }
and
on 1000:text:!deopop:#yourchannel:{ mode #yourchannel -o $nick }
or
on 1000:Text:!botname *:#yourchan:{
if ($$2 == !op) { mode #yourchan +o $nick }
elseif ($$2 == !deop) { mode #yourchan -o $nick }
else { notice $nick you have not requested a valid mode change }
}

or you can read from a text file, an ini file or a hash table to check if the $nick and their address match your ops list
Posted By: SladeKraven Re: mybot - 11/05/06 04:33 AM
Quote:

yes there is, unless you have ops already you cant get ops? that makes no sense.


Isn't that what I said in the first place? Not criticising just wondering if I had the same views as you.
Posted By: MikeChat Re: mybot - 11/05/06 04:42 AM
while you had addressed yourself to the OP I was addressing my comment to othello, who said that the code was fine, which it isnt for the reasons we all stated.
Posted By: SladeKraven Re: mybot - 11/05/06 05:47 AM
For sure I totally agree with that.
Posted By: bojak71730 Re: mybot - 11/05/06 05:57 PM
well the problem is i cant get it to read the file its on my text top the bot has its on folder with mirc and all the stuff mirc needs to run inside of it cause thats what im told to do but i still cant get it to work
© mIRC Discussion Forums