mIRC Home    About    Download    Register    News    Help

Print Thread
#168563 10/01/07 02:54 PM
Joined: May 2005
Posts: 74
D
Dracoz Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: May 2005
Posts: 74
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
  }
}

Dracoz #168565 10/01/07 04:09 PM
Joined: Oct 2003
Posts: 313
S
Fjord artisan
Offline
Fjord artisan
S
Joined: Oct 2003
Posts: 313
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
)


Sais
Dracoz #168567 10/01/07 05:12 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
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 edits his posts 24/7
cold #168580 10/01/07 07:21 PM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
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.


Invision Support
#Invision on irc.irchighway.net
Sais #168591 10/01/07 08:58 PM
Joined: May 2005
Posts: 74
D
Dracoz Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: May 2005
Posts: 74
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.
Dracoz #168592 10/01/07 09:47 PM
Joined: May 2005
Posts: 74
D
Dracoz Offline OP
Babel fish
OP Offline
Babel fish
D
Joined: May 2005
Posts: 74
I whas wondering how to delete a user :')

I only know how to add

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


Invision Support
#Invision on irc.irchighway.net
Joined: Feb 2003
Posts: 810
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Feb 2003
Posts: 810
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 edits his posts 24/7
cold #168616 11/01/07 05:40 AM
Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Ok, that makes sense. smile


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard