I've got a code running thanks to Hixxy, ever so thankful to him <3
However, the code allows me to play a .txt file based off of a skill name, and there are 6 skills which have identical names. So I came up with this code. Can anyone point out what I did wrong?
on *:text:*:#: {
if ( %skill [ $+ [ $nick ] ] > 0 ) {
if ($istok(%am,$1,32)) { msg $chan Anti Mage }
elseif ($istok(%qop,$1,32)) { msg $chan Queen of Pain }
elseif ($istok(%ss,$1,32)) { msg $chan Shadow Shaman }
elseif ($istok(%lion,$1,32)) { msg $chan Lion }
elseif ($istok(%dp,$1,32)) { msg $chan Death Prophet }
elseif ($istok(%drow,$1,32)) { msg $chan Drow Ranger }
else { return }
unset %skill [ $+ [ $nick ] ]
}
else { return }
}
How %skill [ $+ [ $nick ] ] gets set:
alias -l skilldir { return C:\Users\Nillen\Dropbox\BOT\DotaRelated\Skills\ }
on *:text:!skill *:#:{
if ($($+(%,floodchan.,$chan),2)) || ($($+(%,flooddota.,$chan),2)) || ($($+(%,flood.,$nick),2)) { return }
if ($2 == blink) { msg $chan By Blink, did you mean Anti Mage or Queen of Pain? }
if ($2 == silence) { msg $chan By Silence, did you mean Drow Ranger or Death Prophet? }
if ($2 == hex) { msg $chan By Hex, did you mean Lion or Shadow Shaman? }
if (!$isfile($+($skilldir,$remove($2-,$chr(32)),.txt))) { msg $chan Sorry, we have not yet made that skill. If you would like to contribute, please visit https://docs.google.com/spreadsheet/ccc?key=0AhffoErVyWcVdFZWTGxDOVd4OFdaME5xeF9nVk8tamc#gid=0 }
if (!$isfile($+($skilldir,$remove($2-,$chr(32)),.txt))) { return }
set -u10 %floodchan. $+ $chan On
set -u30 %flooddota. $+ $chan On
set -u60 %flood. $+ $nick On
set -u30 %skill [ $+ [ $nick ] ] 1
.play # $qt($+($skilldir,$remove($2-,$chr(32)),.txt)) 0
}
Note that I put a blank .txt file named "blink", "hex" and "silence" in the dir to prevent the bot from running the !$isfile.
The code works fine, but any command I use after this command won't work. I'm highly suspicious of the on *:text:
* :
Or maybe even the: if ( %skill [ $+ [ $nick ] ]
> 0 )
Example: After this code, I have this:
on *:text:!test:#: { msg $chan test } It doesn't trigger at all. If I place it above the broken code, it works fine.