mIRC Homepage
Posted By: sparta Question - 23/08/03 01:09 PM
I couldent find anything that helped me when i searched the forums, i want to set a %var when a user with a serten level joins a channel, i have been trying soon everything in the mirc.hlp file, and i cant get it right.. i must have missed somthing in the file, and i cant figure out what..

on *:JOIN:#: {
if ($nick == master) { .notice $nick You have master status ..... }
.notice $nick Welcome to $chan ...............
}

how can i identify that $nick if he are in my userlist as master? i have been trying the $ulevel - $level(nick) and so on, and still nothing :tongue:
Posted By: Hammer Re: Question - 23/08/03 01:21 PM
on master:JOIN:#:{ commands }
/auser master mask|nick
Posted By: sparta Re: Question - 23/08/03 01:24 PM
I have a trigger for every one that join "on *:JOIN:#":.. but if the nick that join is a master, then i want to send that user a line that the others dont get, it show commands and other stuff, no need to send that to ppl that cant use them.. and i have added him with the level 3 guser $nick 3 .. so i need to match hes host, then check if he have the master status or not.. confused
Posted By: Hammer Re: Question - 23/08/03 01:35 PM
Just put the on master:JOIN:#: line above the on others so it matches first.

on master:JOIN:#:{ master commands }
on 3:JOIN:#:{ userlevel 3 commands }
on *:JOIN:#:{ everybody else's commands }
Posted By: sparta Re: Question - 23/08/03 01:37 PM
OK.. i try that.. thnx laugh
Posted By: landonsandor Re: Question - 23/08/03 02:26 PM
couldnt you also do:

ON *:join:#: {
if ($level($nick) == 3) { stuff-1 }
if ($level($nick) == master) { stuff-2 }
else { stuff three }
}

Wouldnt that be better than 3 different on join events? Asking out of curiosity since I thought if you had 2 of the same type of events in the same file only the first would fire
Posted By: Hammer Re: Question - 23/08/03 04:33 PM
But those three are not the same. You can have only one event FIRE (or activate) for each file, but you can have as many variations on the event header (the bit before the start of the actual scripting code) as your mind can dream up, all in the same file. It's just that when one of them matches and fires, no more events of that type will be examined in that file. mIRC then goes on the the next loaded script file and repeats the process there.


on master:JOIN:#HelpDesk,#mIRC:
on master:JOIN:#Help:
on master:JOIN:#:

These three event headers are all different and only one of them will fire for anyone on the master level. The same thing holds true for the on 3:JOIN: event headers and finally the on *:JOIN: events.

Note that the order they are placed in the file is important. If you want master's to match before checking them for level 3, put the master event headers first in that file. on *:EVENT: should be last as it catches everyone and is roughly the same as the ELSE for that event.

When I have speed tested this in the past, separate events worked faster than a single long event. This seems contrary to how I'd think it would be since mIRC only has to process just the one event. However, if you're only doing just the code required for that event if it fires, mIRC doesn't have to parse anything else at all to see if there are more commands it has to deal with.
© mIRC Discussion Forums