mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jan 2017
Posts: 20
Ameglian cow
OP Offline
Ameglian cow
Joined: Jan 2017
Posts: 20
I made several commands for some small jokes and as I did not find a good guide on everything I had to learn everything myself and by troubleshooting I came close to what the problem is, but I can't fix it.
Here's an example of one of the commands:

on *:text:!d10:#: {
if ((%flooddice) || ($($+(%,flooddice.,$nick),2))) { return }
set -u10 %flooddice. $+ $nick On
msg $chan $nick $read(d10.txt)
else {
msg $chan $nick , no fair, you just rolled, give the others a turn to prepare... 50DKP minus! }
}


As I said, I didn't find good explanations on the commands, however I feel like the or part is causing confusion... maybe?


Streaming games on Twitch, while guiding and helping other players!
www.twitch.tv/vijoplays
Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
It would help to know what you are wanting the above command to actually do. smile

Joined: Jan 2017
Posts: 20
Ameglian cow
OP Offline
Ameglian cow
Joined: Jan 2017
Posts: 20
Yes, I'm sorry.^^
I was just taking a shower and then I realized that I didn't even post what I wanted it to do, lol.

I want the command to either roll a 1-20 (which is happening without a problem) and then give that person a cooldown.
If this person tries to roll again while on cooldown I want a message in chat to display saying the 50DKP minus stuff. smile


Streaming games on Twitch, while guiding and helping other players!
www.twitch.tv/vijoplays
Joined: Oct 2015
Posts: 112
B
Vogon poet
Offline
Vogon poet
B
Joined: Oct 2015
Posts: 112
The script you are using is written to "do nothing" if the user is on cooldown for the command:
Code:
if ((%flooddice) || ($($+(%,flooddice.,$nick),2))) { return }

We need to tell mIRC to do something else if the user is on cooldown.

First off, you don't appear to be using "%flooddice" at all, as I am assuming that you got that from a youtube tutorial, so let's just get rid of it. Instead, I would rather first tell mIRC what to do if the user is NOT on cooldown, THEN tell it what to do if the user IS on cooldown. That just makes more sense in my brain. The ! symbol in (!$($+(%,flooddice.,$nick),2)) tells mIRC to do stuff if that vairable does NOT exist.

Code:
on *:text:!d10:#: {
  if (!$($+(%,flooddice.,$nick),2)) {
    set -u10 %flooddice. $+ $nick On
    msg $chan $nick $read(d10.txt)
  }
  else msg $chan $nick $+ , no fair, you just rolled, give the others a turn to prepare... 50DKP minus! 
}

Joined: Jan 2017
Posts: 20
Ameglian cow
OP Offline
Ameglian cow
Joined: Jan 2017
Posts: 20
Yep, that's it! Thank you very much. <3

And you are indeed correct, I might just be blind (as I am sometimes when looking for something :p), but I did not find a good explanation of the commands themselves.
However, all commands work now, except for an automatic message and a few other commands that I did not look into yet, but are still on the list. =)

Thanks again, much appreciated!


Streaming games on Twitch, while guiding and helping other players!
www.twitch.tv/vijoplays

Link Copied to Clipboard