mIRC Homepage
Posted By: KubosKube Execute $$2- as Code - 08/02/17 02:50 AM
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.
Posted By: Wims Re: Execute $$2- as Code - 08/02/17 02:53 AM
$eval(,2)

Be careful, I suggest protecting this by limiting the usage only in private and with a password.
Posted By: KubosKube Re: Execute $$2- as Code - 08/02/17 12:07 PM
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.
Posted By: Wims Re: Execute $$2- as Code - 08/02/17 12:30 PM
The correct usage is $eval(text,2), so $eval($$2,2).
$eval(,text) being equal to $eval(text,2) is a quirk.
© mIRC Discussion Forums