mIRC Homepage
Posted By: Dracoz !say bot command - 10/01/07 02:54 PM
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
  }
}
Posted By: Sais Re: !say bot command - 10/01/07 04:09 PM
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
)
Posted By: Riamus2 Re: !say bot command - 10/01/07 05:12 PM
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.
Posted By: cold Re: !say bot command - 10/01/07 05:29 PM
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.
Posted By: Riamus2 Re: !say bot command - 10/01/07 07:21 PM
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.
Posted By: Dracoz Re: !say bot command - 10/01/07 08:58 PM
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
Posted By: Dracoz Re: !say bot command - 10/01/07 09:47 PM
I whas wondering how to delete a user :')

I only know how to add
Posted By: Riamus2 Re: !say bot command - 10/01/07 09:59 PM
I don't have mIRC in front of me, but I think it's /ruser.
Posted By: cold Re: !say bot command - 11/01/07 05:12 AM
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.
Posted By: Riamus2 Re: !say bot command - 11/01/07 05:40 AM
Ok, that makes sense. smile
© mIRC Discussion Forums