mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#78241 06/04/04 10:33 PM
Joined: Feb 2004
Posts: 33
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
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!!!
#78242 06/04/04 11:25 PM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
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
#78243 06/04/04 11:41 PM
Joined: Feb 2004
Posts: 33
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
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.

Last edited by masterofpuppets; 06/04/04 11:44 PM.

Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!
#78244 07/04/04 12:13 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
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
#78245 07/04/04 12:30 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
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
#78246 07/04/04 12:33 AM
Joined: Feb 2004
Posts: 33
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
Posts: 33
Nope, it didn't work. Totally unresponsive!


Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!
#78247 07/04/04 12:39 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
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
#78248 07/04/04 12:44 AM
Joined: Feb 2004
Posts: 33
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
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!!!
#78249 07/04/04 12:49 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
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
#78250 07/04/04 12:51 AM
Joined: Dec 2003
Posts: 261
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
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
#78251 07/04/04 12:53 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
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
#78252 07/04/04 12:54 AM
Joined: Feb 2004
Posts: 33
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
Posts: 33
It's still totally defunc.


Adrenaline starts to flow, thrashing all around, acting like a maniac, WHIPLASH!!!
#78253 07/04/04 01:04 AM
Joined: Dec 2003
Posts: 261
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
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)

Last edited by milosh; 07/04/04 01:07 AM.

velicha dusha moja Gospoda
#78254 07/04/04 01:07 AM
Joined: Dec 2002
Posts: 1,541
L
Hoopy frood
Offline
Hoopy frood
L
Joined: Dec 2002
Posts: 1,541
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
#78255 07/04/04 01:12 AM
Joined: Feb 2004
Posts: 33
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
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!!!
#78256 07/04/04 01:16 AM
Joined: Dec 2003
Posts: 261
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
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
#78257 07/04/04 01:18 AM
Joined: Dec 2003
Posts: 261
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
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
#78258 07/04/04 01:22 AM
Joined: Feb 2004
Posts: 33
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
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!!!
#78259 07/04/04 01:26 AM
Joined: Dec 2003
Posts: 261
M
Fjord artisan
Offline
Fjord artisan
M
Joined: Dec 2003
Posts: 261
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
#78260 07/04/04 01:34 AM
Joined: Feb 2004
Posts: 33
M
Ameglian cow
OP Offline
Ameglian cow
M
Joined: Feb 2004
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!!!
Page 1 of 2 1 2

Link Copied to Clipboard