This is a mIRC snippet for a vHost system. The bot on which this is run must have the correct IRCop privilege to set vHosts, and it must be in your request and accept channels
You MUST set two variable for this to work:
%request.chan
%review.chan
The rest will take care of itself.
Planned updates:
[ ] Save all accepted vHosts to a .txt file
[ ] Add a queue to the system
[ ] Clean up the code a bit
Updates:
Changed %var =
To unset %var
If you have suggestions for any other updates, such as how to make this system less "exploitable" Please comment below.
And remember, this is my second public snippet, so please be nice.
on 1:TEXT:!request *:%request.chan: {
%pending = true
%request.host = $2
%request.nick = $nick
msg %request.chan %request.nick, You have requested vHost: %request.host Please wait for an IRCOp to approve it.
msg %review.chan Attn All online Opers: %request.nick Requests vHost: %request.host
msg %review.chan Type !accept or !deny to Accept/deny %Vhost
}
on 1:TEXT:!accept:%review.chan: {
if %pending = true {
msg hostserv set %request.nick %request.host
msg %review.chan vHost request: %request.host for %request.nick accepted.
msg %request.chan %request.nick Your request for %request.host has been accepted. To activate it, please type /msg hostserv on
%lasthost.accept = %request.host
unset %request.host
unset %request.nick
unset %pending
}
else {
msg %review.chan there are no vHost requests pending!
}
}
on 1:TEXT:!deny:%review.chan: {
if %pending = true {
msg %review.chan vHost request: %request.host for %request.nick denied.
msg %request.chan %request.nick Your request for %request.host has been denied. Please /part %request.chan
unset %request.host
unset %request.nick
unset %pending
}
else {
msg %review.chan there are no vHost requests pending!
}
}
on 1:TEXT:!last:%review.chan: {
msg %review.chan Last accepted host was %lasthost.accept
}
Also whats that all on its own?
I guess it unsets them (nether really tried that method) but yeah unset %var should work.
'%var =' (followed by a space or end of line) gets mapped directly onto 'set %var' early on by mIRC's interpreter. thus '%var = value' as a command is exactly equivalent to 'set %var value' - remember that /set modifies local variables and only creates a global variable if a local one of that name doesn't exist.
the procedure that does this mapping is a bit greedy: it also plays a role in the evaluation of the arguments to an identifier (which is a slightly different evaluation routine in a number of ways). this really is silly, but at least it allows me to produce proof of the above claim :P
//echo -a $+(a, %var =, b) and $replace(a, a, %var =)