mIRC Home    About    Download    Register    News    Help

Print Thread
S
spermis
spermis
S
What i need to add in script so only users can use ONTEXT command that is in script, whos IP is listed in a .txt file

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
I'd suggest user the user list and access levels instead of a text file.

User list might contain:

CanUse:*!*@111.111.111.111
CanUse:*!*@222.222.222.222

Etc.

Then your on TEXT would be:

on CanUse:TEXT:*:#: { }

You can, of course use some name other than "CanUse" or just use a number instead of a name for the level.

S
spermis
spermis
S
i found a guide about lists and understand a lot from it.. but still cant understand how to make this command work only if user is on level 7
Code:
if (($nick isop %gatherchan) || (($nick isvoice %gatherchan) && (%gathervoiceon == ON))) && ($1 == %gathertegn $+ on) {


And how to remove tha isop and isvoice and gathervoice == ON so it dont give bug. Cuz i only want that that command works only if user is on lvl 7.. ok not lvl7 but CanUse..

I wont try but i think

Code:
on CanUse && ($1 == %gathertegn $+ on) {


is that right? i guess not ^^

Last edited by spermis; 01/03/07 07:46 PM.
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Well, first you need that command in an event. For example, if it's an on TEXT event, you'd use:

on 7:text:*:#: { }

Just change it around as needed. The main thing is the 7 or whatever level you use (named or numerical). Personally, I like named levels for things like this because it helps to keep track of what the levels are for, but it's up to you. Both will work equally well.

A question about your code, though...

&& ($1 == %gathertegn $+ on)

Is there a reason you're adding "on" to the end of whatever the variable is? Just making sure because it doesn't make sense to me. smile

And, your "on CanUse" part isn't valid. You need to use a real event (on TEXT, on INPUT, on JOIN, on QUIT, etc.).

S
spermis
spermis
S
its there because %gathertegn means ! .. it can be ? - + or antyhing that is specified in my remote.ini file.. and so it means ! + on = !on

n27=%gathertegn !

this is the line from remote.ini

but if you want you can remove the %gathertegn from that line and just type ontext !on because i wont change it anyway.. and should the remove the gathervoiceon thingy and isop.. just user group.. name of group - CupAdmin

EDit2: Oh and if you dont see the first code
Quote:
if (($nick isop %gatherchan) || (($nick isvoice %gatherchan) && (%gathervoiceon == ON))) && ($1 == %gathertegn $+ on) {

here it is

Last edited by spermis; 01/03/07 07:49 PM.
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Again, you need an event. If it's on TEXT, you have:

on CupAdmin:TEXT:*:#: { }

You won't need the isop/isvoice stuff at all if you have everyone set up in the group.

I see what you were doing with the variable. You can leave it like that and make it changeable that way or remove it. The choice is yours.

S
spermis
spermis
S
but how to set it right? the text event

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
That is how. Just put your stuff into the brackets. Because I don't have your script, I can't tell you more than how to format the event... which I did many times.

S
spermis
spermis
S
do i have to add it like this { $1 == %gathertegn $+ on } or liek this { %gathertegn $+ on }

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
The first one (make sure it's in an IF statement as you had it before and not by itself).

S
spermis
spermis
S
on CupAdmin:TEXT:*:#: if { $1 == %gathertegn $+ on }

like this?

T
Trixar_za
Trixar_za
T
Not quite, the if should be in the bracket like:

Code:
on CupAdmin:TEXT:*:#:{if $1 == %gathertegn $+ on }


Also for each if (and line) in it smile

Code:
on CupAdmin:TEXT:*:#:{if $1 == %gathertegn $+ on
                      if $1 == %gathertegn2 $+ on
}


or something like that

Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
You forgot a space after the {, which will cause an error. Here you go (with a coulple of other changes):

Code:
on CupAdmin:TEXT:*:#:{
  if ($1 == %gathertegn $+ on) { do something here }
  elseif ($1 == %gathertegn2 $+ on) { do something here }
}


Link Copied to Clipboard