mIRC Home    About    Download    Register    News    Help

Print Thread
#168563 10/01/07 02:54 PM
D
Dracoz
Dracoz
D
I got a script when i type !say blabla the bot wil say blabla in the same channel, but i need something that will improve this script i now got $1 $2 etc etc....
And something that not if $adress == blabla
But if the adress is in a certain text file,,
Hope that someone can help me this is the code...

Code:
on *:TEXT:!say*:#: {
  if ($address == Dracoz@Omerta-9c60a577.only.thing.we.fear.is.running.out-of-beer.nl) {
    /msg $chan $2 $3 $4 $5 $6 $7 $8 $9 $10 $11 $12
  }
}

#168565 10/01/07 04:09 PM
Joined: Oct 2003
Posts: 284
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 284
I'd note first off that $1- is everything from $1 on, and $1-12 is everything from $1 to $12 (inclusive).

Second, userlevels may do what you're looking for - /help /guser and /help access levels, and:
Code:
on mylevel:TEXT:!say*:#: {
    msg $chan $2-
}

Where you have added the address *!Dracoz@Omerta-9c60a577.only.thing.we.fear.is.running.out-of-beer.nl to userlevel "mylevel" (e.g. via
Code:
/auser mylevel *!Dracoz@Omerta-9c60a577.only.thing.we.fear.is.running.out-of-beer.nl
)

#168567 10/01/07 05:12 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Also, you should probably put in some protection to the script -- prevent it from running dangerous/bad commands.

For example:

!say hello | quit

That will make you say hello, then quit. And that's a very minor issue... there are commands that can be used that can do some real damage. Yes, you're limiting this to specific user(s), but even so, unless only YOU have access to it, it's best to play it safe.

Joined: Feb 2003
Posts: 806
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 806
Originally Posted By: Riamus2
For example:

!say hello | quit

That will make you say hello, then quit.

That won't happen, Riamus2. The pipe ('|') would be interpreted as a line separator only if you used a script like this:
Code:
on mylevel:TEXT:!say*:#:{ scid -r msg $chan $2- }
; or:   on mylevel:TEXT:!say*:#:{ .timer 1 0 msg $chan $2- }


Leaving $2- as it is there is safe.

cold #168580 10/01/07 07:21 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
I can't test that here, but why would:

/msg $chan $1-

not treat the | as a separator? This is why you have the switch for $read, so that you can not interpret lines as commands, right? Anyhow, I've never tried it, but it seems like it would be an issue. If not, then that's great.

Sais #168591 10/01/07 08:58 PM
D
Dracoz
Dracoz
D
Hmmm i cant see the mylevel code shocked
Can someone explain it to me i dont understand the

/help levels

*EDIT*

Ok i got it xD
Thanks it works great laugh

Last edited by Dracoz; 10/01/07 09:04 PM.
#168592 10/01/07 09:47 PM
D
Dracoz
Dracoz
D
I whas wondering how to delete a user :')

I only know how to add

#168596 10/01/07 09:59 PM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
I don't have mIRC in front of me, but I think it's /ruser.

Joined: Feb 2003
Posts: 806
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 806
Originally Posted By: Riamus2
I can't test that here, but why would:

/msg $chan $1-

not treat the | as a separator? This is why you have the switch for $read, so that you can not interpret lines as commands, right?


What happens here is that $1- is evaluated, then its content is considered a "pure" string, regardless of what's in it. I mean, $1- isn't evaluated twice, only once.
$read(), on the other hand, is evaluated twice (unless you use the 'n' switch). It was designed this way -- at first, its only purpose was to pick a line randomly from a file and interpret it as a script line.
By the way, I think that the 'n' behaviour should be $read's default, but I guess this would break a lot of (if not all) scripts.

cold #168616 11/01/07 05:40 AM
Joined: Oct 2004
Posts: 8,061
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Oct 2004
Posts: 8,061
Ok, that makes sense. smile


Link Copied to Clipboard