mIRC Home    About    Download    Register    News    Help

Print Thread
Execute $$2- as Code #259879 08/02/17 02:50 AM
Joined: Jan 2017
Posts: 56
KubosKube Offline OP
Babel fish
OP Offline
Babel fish
Joined: Jan 2017
Posts: 56
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.

Re: Execute $$2- as Code [Re: KubosKube] #259880 08/02/17 02:53 AM
Joined: Jul 2006
Posts: 3,697
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,697
$eval(,2)

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


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Execute $$2- as Code [Re: Wims] #259883 08/02/17 12:07 PM
Joined: Jan 2017
Posts: 56
KubosKube Offline OP
Babel fish
OP Offline
Babel fish
Joined: Jan 2017
Posts: 56
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.

Re: Execute $$2- as Code [Re: KubosKube] #259884 08/02/17 12:30 PM
Joined: Jul 2006
Posts: 3,697
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,697
The correct usage is $eval(text,2), so $eval($$2,2).
$eval(,text) being equal to $eval(text,2) is a quirk.


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net