mIRC Home    About    Download    Register    News    Help

Print Thread
#259879 08/02/17 02:50 AM
Joined: Jan 2017
Posts: 57
Babel fish
OP Offline
Babel fish
Joined: Jan 2017
Posts: 57
So, I use the command "!sudo x" to make mIRC do things when I'm not at my computer. I log into the chat on my phone at work and type "!sudo rpgMerchant" and it executes the alias labeled "rpgMerchant".

However, what I'm trying to figure out is how to make it execute parameters such at $rand(1,100).

A sample of what it looks like currently.

Message: "!sudo msg #channelname Random number! $rand(1,100)"
Response: "ExampleBot > Beep beep boop. Sudo Recieved. Executing..."
Message: "!sudo msg #channelname Random number! $rand(1,100)"
Response: "Random Number! $rand(1,100)"

This is my code.

on *:TEXT:!sudo*:#: {
if ($nick == kuboskube) {
msg $chan /me > Beep beep boop. Sudo Recieved. Executing...
$$2-
}
}

PS - I haven't figured out users yet, else I'd use power levels instead of an if statement. That's my next goal after I get my current scripts finished.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
$eval(,2)

Be careful, I suggest protecting this by limiting the usage only in private and with a password.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Jan 2017
Posts: 57
Babel fish
OP Offline
Babel fish
Joined: Jan 2017
Posts: 57
Alright, so I tried $eval(,2) and it didn't work at first, but I replaced "2" with "$$2-" and it works fine.

$eval(,$$2-)

Thanks for your help. laugh
I plan to make this available only to the top-ranked users in the users list, and that's going to happen very soon.

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
The correct usage is $eval(text,2), so $eval($$2,2).
$eval(,text) being equal to $eval(text,2) is a quirk.


#mircscripting @ irc.swiftirc.net == the best mIRC help channel

Link Copied to Clipboard