mIRC Home    About    Download    Register    News    Help

Page 1 of 2 1 2 >
Topic Options
#78241 - 06/04/04 11:33 PM Bot problem
masterofpuppets Offline
Ameglian cow

Registered: 27/02/04
Posts: 33
Ok, this is really annoying now. I am trying to create a bot for my new server (not open to public yet though) and it will just NOW do any commands. The one which I am having most trouble with is the !op command. I test it by opening two clients and using one as the bot with the script loaded. Here is the code:

Code:
on !6:TEXT:!mopop *:#: {
  if ($ulevel == 6) {
  mode $1 +o $2 }
  else {
  msg $nick You don't have the user levels to do that! }
}


Now. When I use the client non-bot client to activate the script, there is no response. I have set my hostname to work with level 6 commands. HELP! The deop command and basicly all commands that require user levels don't respond!
_________________________
Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!

Top
#78242 - 07/04/04 12:25 AM Re: Bot problem
landonsandor Offline
Hoopy frood

Registered: 12/12/02
Posts: 1527
Loc: state of confusion
There's a bit of redundancy here:

on !6:TEXT:!mopop *:#: {
if ($ulevel == 6) {
mode $1 +o $2 }
else {
msg $nick You don't have the user levels to do that! }
}


Ok, so you want only user level 6 to be able to trigger this. So let's try a few things. First, how many ON TEXT events do you have of level 6 nature in the same remote file? More than one can cause problems. Also, try some of the code below:


on !6:TEXT:!mopop *:#://mode $1 +o $2

In the above the blue is not needed because on text events CANT be triggered by the script host (the one running the script). Im alos going to assume by your code that the format for said command is !mopop #channelname nickname

Something else you can do is:

on +6:TEXT:!mopop *:#://mode $1 +o $2

The above script because of the + means ONLY level 6 users can trigger said event. Another solution would be (since it appears you want to respond to NON level 6 users with a message):

on *:text:!mopop *:#: {
if ($ulevel == 6) { mode $1 +o $2 }
else { msg $nick You don't have the user levels to do that! }
}

Another idea you could try is:

on @*:text:!mopop *:#: {
if ($ulevel == 6) { mode $1 +o $2 }
else { msg $nick You don't have the user levels to do that! }
}

In the above, the @ means "dont trigger this event UNLESS I (the one running the script) am opped

You COULD (if you wanted to) even combine things from above like this:

on @+6:TEXT:!mopop *:#://mode $1 +o $2

The above means:
1) If I am opped
2) the user triggering the event has level 6 access
3) perform the script


I hope all of this helps you out. Im not the best iwth userlevels, but this is jsut an example and shoudl give you ideas smile
_________________________
Those who fail history are doomed to repeat it

Top
#78243 - 07/04/04 12:41 AM Re: Bot problem
masterofpuppets Offline
Ameglian cow

Registered: 27/02/04
Posts: 33
Ok, it at least messages me with the You Dont have Levels message. So, tht means I have a problem with me users file.
BUT, it even does it when I have the default user level at 6. Wierd!

Code:
on :TEXT:!request MoPBoT *:#: {
if ($ulevel == 6){ join $3 }
else { msg $nick You don't have the user levels to do that! }

on *:text:!mopop *:#: {
  if ($ulevel == 4) { mode $1 +o $2 }
  else { msg $nick You don't have the user levels to do that! }
}

on *:text:!mopdeop *:#: {
  if ($ulevel == 4) { mode $1 -o $2 }
  else { msg $nick You don't have the user levels to do that! }
}

on *:text:!moptopic *:#: {
  if ($ulevel == 4) { topic $1 $2 }
  else { msg $nick You don't have the user levels to do that! }
}

on *:text:!mopvoice *:#: {
  if ($ulevel == 4) { mode $1 +v $2 }
  else { msg $nick You don't have the user levels to do that! }
}


ALL of those functions have the same result. That stupid User Levels query.


Edited by masterofpuppets (07/04/04 12:44 AM)
_________________________
Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!

Top
#78244 - 07/04/04 01:13 AM Re: Bot problem
landonsandor Offline
Hoopy frood

Registered: 12/12/02
Posts: 1527
Loc: state of confusion
Ok, it COULD be (unless it's just a typo HERE) that you're missing a bracket AND missing a space on the first blue section:

{code}
on :TEXT:!request MoPBoT *:#: {
if ($ulevel == 6) { join $3 }
else { msg $nick You don't have the user levels to do that! }
}
on *:text:!mopop *:#: {
if ($ulevel == 4) { mode $1 +o $2 }
else { msg $nick You don't have the user levels to do that! }
}

on *:text:!mopdeop *:#: {
if ($ulevel == 4) { mode $1 -o $2 }
else { msg $nick You don't have the user levels to do that! }
}

on *:text:!moptopic *:#: {
if ($ulevel == 4) { topic $1 $2 }
else { msg $nick You don't have the user levels to do that! }
}

on *:text:!mopvoice *:#: {
if ($ulevel == 4) { mode $1 +v $2 }
else { msg $nick You don't have the user levels to do that! }
}
[/code]

Also, you could do this (tho I MIGHT screw up the coding a bit so be warned):

Code:
on *:text:*:#: {
  if ($ulevel == 4) {
    if (!mopop == $1) { mode $1 +o $2 }
    if (!mopdeop == $1) { mode $1 -o $2 }
    if (!moptopic == $1) { topic $1 $2 }
    if (!mopvoice == $1) { topic $1 +v $2 }
  }
  if ($ulevel == 6) {
    if (!request*MoPBoT iswm $1-) { join $3 }
  }
  else { msg $nick You don't have the user levels to do that! }
}



The above code would also allow for more comparisons and less event titles making things a bit clearer (possibly) for you and also remove a lot of repetitive code. See if that helpsand if anybody else spots an error in my coding, PLEASE correct it smile
_________________________
Those who fail history are doomed to repeat it

Top
#78245 - 07/04/04 01:30 AM Re: Bot problem
landonsandor Offline
Hoopy frood

Registered: 12/12/02
Posts: 1527
Loc: state of confusion
OOOOOOOOO I see another problem here. Try this:

Code:
on *:text:*:#: {
  if ($ulevel == 4) {
    if (!mopop == $1) { mode [color:blue]#[/color] +o $2 }
    if (!mopdeop == $1) { mode [color:blue]#[/color] -o $2 }
    if (!moptopic == $1) { topic [color:blue]#[/color] $2 }
    if (!mopvoice == $1) { mode [color:blue]#[/color] +v $2 }
  }
  if ($ulevel == 6) {
    if (!request*MoPBoT iswm $1-) { join $3 }
  }
  else { msg $nick You don't have the user levels to do that! }
}


Stupid me, how can you set any moes on $1 if $1 is the !trigger?? *smack* (among another typo I found in the voice command) . Also, in the !request MoPBoT part, is $3 the actual channelname?
_________________________
Those who fail history are doomed to repeat it

Top
#78246 - 07/04/04 01:33 AM Re: Bot problem
masterofpuppets Offline
Ameglian cow

Registered: 27/02/04
Posts: 33
Nope, it didn't work. Totally unresponsive!
_________________________
Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!

Top
#78247 - 07/04/04 01:39 AM Re: Bot problem
landonsandor Offline
Hoopy frood

Registered: 12/12/02
Posts: 1527
Loc: state of confusion
Is somebody OTHER than the script hlder testing this? You should be getting SOME KIND of response. Hmm, try this (for error checking):

Code:
on *:text:*:#: {
  echo -a On Text worked
  if ($ulevel == 4) {
    echo -a It recognized user level 4
    if (!mopop == $1) { mode # +o $2 }
    if (!mopdeop == $1) { mode # -o $2 }
    if (!moptopic == $1) { topic # $2 }
    if (!mopvoice == $1) { mode # +v $2 }
  }
  if ($ulevel == 6) {
    echo -a It recognized user level 6
    if (!request*MoPBoT iswm $1-) { join $3 }
  }
  else { msg $nick You don't have the user levels to do that! }
}


if it still doesnt trigger anything, somebody else'll have to help you as Im missing somthing (probably really stupid). Also, what do you normally keep your own (the mirc that runs the scripts) default user level at? Are you trying it at default level as 1? Another number? If at another number, try it at one and see what happens
_________________________
Those who fail history are doomed to repeat it

Top
#78248 - 07/04/04 01:44 AM Re: Bot problem
masterofpuppets Offline
Ameglian cow

Registered: 27/02/04
Posts: 33
Ok, the ontext worked and it recognised user level 6. But nothing happened.
_________________________
Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!

Top
#78249 - 07/04/04 01:49 AM Re: Bot problem
landonsandor Offline
Hoopy frood

Registered: 12/12/02
Posts: 1527
Loc: state of confusion
Ok, for now Im gonna pass this on to somebody else who knows more than I do cause it LOOKS right to me, but Im prolly making a SIMPLE mistake somehwere that Im just not seeing (cause I wrote the code lol). Hopefully one of the better scripters can guide you beyond here smile
_________________________
Those who fail history are doomed to repeat it

Top
#78250 - 07/04/04 01:51 AM Re: Bot problem
milosh Offline
Fjord artisan

Registered: 24/12/03
Posts: 261
Loc: Srbija
Hi, there. Tested... this works fine for me:
Code:
on *:text:*:#: {
  if ($ulevel == 4) { 
    if (!mopop == $1) { mode # +o $2 } 
    if (!mopdeop == $1) { mode # -o $2 }
    if (!moptopic == $1) { topic # $2 }
    if (!mopvoice == $1) { mode # +v $2 }
  }
  [color:red]elseif[/color] ($ulevel == 6) { 
    if ([color:red]!request MoPBoT == $1-2[/color]) { join $3 }
  } 
  else { msg $nick You don't have the user levels to do that! }
}


landonsandor, you did a good job man, just a little red things. grin
_________________________
velicha dusha moja Gospoda

Top
#78251 - 07/04/04 01:53 AM Re: Bot problem
landonsandor Offline
Hoopy frood

Registered: 12/12/02
Posts: 1527
Loc: state of confusion
What's your default user level in ALT + R --> Options --> Default Level? Same to you masterofpuppets, what's your default userlevel when you're testing the script? Im not keen on user levels when the script owner has a default level other than 1. BTW milosh, thanks for the backing up, I thought it looked right to me, but again, I coded it so I can sometimes overlook simple issues smile

_________________________
Those who fail history are doomed to repeat it

Top
#78252 - 07/04/04 01:54 AM Re: Bot problem
masterofpuppets Offline
Ameglian cow

Registered: 27/02/04
Posts: 33
It's still totally defunc.
_________________________
Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!

Top
#78253 - 07/04/04 02:04 AM Re: Bot problem
milosh Offline
Fjord artisan

Registered: 24/12/03
Posts: 261
Loc: Srbija
landonsandor, def level 1
masterofpuppets, cerate a new script file, enter the landonsandor's code with two corrections (see my post).
Type !mppop <nick> to give <nick> the op, type !request MoPBoT #channel, to make the bot enter the channel.

Oh, give level 4 and 6 to your own nick (the nick who's executing the commands)


Edited by milosh (07/04/04 02:07 AM)
_________________________
velicha dusha moja Gospoda

Top
#78254 - 07/04/04 02:07 AM Re: Bot problem
landonsandor Offline
Hoopy frood

Registered: 12/12/02
Posts: 1527
Loc: state of confusion
Didnt think of the $1-2 thing milosh. I knew about it, just didnt think about it lol Hope that made sence lol Also, i didnt think it would matter if I used elseif vs another if, but hey, if it works, then fine, that's all that matters
_________________________
Those who fail history are doomed to repeat it

Top
#78255 - 07/04/04 02:12 AM Re: Bot problem
masterofpuppets Offline
Ameglian cow

Registered: 27/02/04
Posts: 33
But the thing is, it DOESN'T work fine. Even with those corrections! Wierd.
_________________________
Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!

Top
#78256 - 07/04/04 02:16 AM Re: Bot problem
milosh Offline
Fjord artisan

Registered: 24/12/03
Posts: 261
Loc: Srbija
Let's say you put if instead of elseif and you don't have 4 or 6. Then you will not get the error msg (msg $nick You don't have the user levels to do that! will NOT be executed).
It WILL be executed only if you have level 6 and do not type !request MoPBoT. That's why I did elseif to your code. :tongue:
_________________________
velicha dusha moja Gospoda

Top
#78257 - 07/04/04 02:18 AM Re: Bot problem
milosh Offline
Fjord artisan

Registered: 24/12/03
Posts: 261
Loc: Srbija
Can you tell us what are you typing, what are the commands, give an example, like I did: !mopop <nick> will op the <nick> in current channel.
_________________________
velicha dusha moja Gospoda

Top
#78258 - 07/04/04 02:22 AM Re: Bot problem
masterofpuppets Offline
Ameglian cow

Registered: 27/02/04
Posts: 33
I tried without any user levels at all. It was un-responsive.
_________________________
Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!

Top
#78259 - 07/04/04 02:26 AM Re: Bot problem
milosh Offline
Fjord artisan

Registered: 24/12/03
Posts: 261
Loc: Srbija
Did you made a new script file and post the code in? I hate this short post, but what can man do. smirk
With no level you will get You don't have the user levels to do that!
_________________________
velicha dusha moja Gospoda

Top
#78260 - 07/04/04 02:34 AM Re: Bot problem
masterofpuppets Offline
Ameglian cow

Registered: 27/02/04
Posts: 33
It didn't query me saying about that I don't have the user levels. It didnt even RESPOND! BUT! The request script works fine. The other ones don't.
_________________________
Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!

Top
Page 1 of 2 1 2 >