mIRC Coder tools
Platform: mIRC
Published Nov 28, 2011
Updated Nov 29, 2011
After making my Topic script i found medelling with 'two dimensional' vars tiresome and annoying.
So, I've created a way to simplify double variables below I have made a simple way to handle them for those new to irc or those who like a bit of help here and there before they step into the main stream stuff in mIRC.
I will add more snippets below as i come across them!
; mIRC Coder Tools
; By Thomas Edwards (TMFKSOFT)
; This script contains commands that you will find to be of great use in bot creation
; If you use any of it please leave credit to myself!
; Feel free to remove commenting when using in your scripts.
; Better vars, giving our code some type of standards is whats best this will speed the process.
alias setvar {
;Usage: /setvar [main var] [sub var] [value]
; e.g. /setvar talk #ilkotech 0
; Which is the same was %talk.#ilkotech
; This allows different vars for different channels.
set % $+ $1 $+ . $+ $2 $3-
}
alias getvar {
;Usage $getvar([main var],[sub var])
; e.g. if ($getvar(talk,#ilkotech == 1) { HALT } else { msg # Hello. }
; This gets the result of a var set via the /setvar command.
; It will return $null by default
return % [ $+ [ $1 ] $+ . $+ [ $2 ] ]
}
alias unsetvar {
;Usage: /unsetvar [main var] [sub var]
; e.g. unset talk #ilkotech
; Will unset the previously set var, It may be used for normal vars e.g. unsetvar %test
unset % $+ $1 $+ . $+ $2
}
; More to come as I dig it up...
; Fixes
; * Fixed that sleeply slurr on initiating a variable before return.
; * Aded the simpler brackets.