This is a script i was working on, to have control and a nice overview of the users in the game that im playing, which supports a jailing function. And since we all use mirc, i thought this would be a great idea.
Its simple as it is, .jail and .unjail . And ofcourse you're able to view the lists etc.
This aint only for "jails", it can be used for other stuff, the only stuff you would need to change is the trigger and the texts.
!Special thanks to LO_KEY, for doing the finals, and checking through!
Edit: Added with the help of LO_KEY a ammount of time aswell. now you type ".jail " :]
Edit: Added the function to jail someone in minutes instead, since that was a bit mroe usfull for me.
So, incase you want to use minutes instead of seconds, change line (32) from (var %timer = $3) to (var %timer = $3 * 60) and line (34) from '(' ( $+ $duration($3) $+ ). ')' to '(' ( $+ $duration(%timer,$3) $+ ). ')'
I hope you guys will enjoy this script just as much as I am :p
EDIT:
Updated the script with a function so it shows who jailed the user, and also if a reason was input, it shows that.
Also added a clear function, incase the file is full or you simply have too many jailed :)
HF
menu channel {
Jailing overview system $iif(%jail, $+($chr(40),$v1,$chr(41)), (None))
.$iif(%jail,Change, Set jaling overview channel):set -s %jail #$$?="Enter the #Channel:"
}
on *:TEXT:.*:%jail: {
if ( .jailsys == $1 ) {
if ( $2 == on ) {
if ($nick !isop #) {
msg # ( $+ $nick $+ ), You do not have the authority to do this
goto end
}
if (!$readini(jail.ini,conf,stat)) { writeini jail.ini conf stat 1
msg $chan Jailing overview enabled!
msg $chan Jailing overview for ( $+ $chan $+ ) is now in session.
}
else msg # ( $+ $nick $+ ) the jailing overview is already enabled.
}
elseif ( $2 == off ) {
if ($nick !isop #) {
msg # ( $+ $nick $+ ), You do not have the authority to do this
goto end
}
if ($readini(jail.ini,conf,stat)) {
.remove jail.ini
msg $chan Jailing overview disabled!
msg $chan Jailing overview for ( $+ $chan $+ ) is NOT in session!
}
else { msg # ( $+ $nick $+ ) the jailing overview is already disabled. }
}
elseif ($nick !isop $chan) { msg # ( $+ $nick $+ ), You do not have authority to do that action. }
}
elseif ( $1 == .jail ) {
if ($nick !isop #) {
msg # ( $+ $nick $+ ), You do not have the authority to do this
goto end
}
if ($readini(jail.ini,conf,stat)) {
if ($readini(jailuser.ini, Jail, $2)) {
msg # Sorry $+($nick,$chr(44)) $2 is already Jailed
goto end
}
elseif (!$readini(jailuser.ini, Jail, $2)) {
writeini jailuser.ini jail $2 $nick $iif($4-,$4-,-NONE-) $chr(32)
var %reason = $4-
;write jail2.txt $nick
;write jail2.txt $4-
var %timer = $3 * 60
if (%timer isnum) {
msg # The requested user ( $+ $2 $+ ) will now be jailed for ( $+ $duration(%timer,$3) $+ ) by $nick $+ , Reason: $iif($4-,$4-,-NONE-)
$+(.timer,$2,unjailini) 1 %timer remini jailuser.ini jail $2
$+(.timer,$2,unjailmsg) 1 $calc(%timer + 1) msg $chan The user ( $+ $2 $+ ) shall now be unjailed.
}
if ($3 !isnum) {
msg # The requested user ( $+ $2 $+ ) will now be jailed for an Unspecified amount of time, with the reason: $iif($4-,$4-,-NONE-)
}
}
else {
msg # Insufficient Parameters: .jail 'The user that shall be jailed' 'time' 'reason' (Without quotes).
}
}
else {
msg # The jailing overview system is not enabled.
}
}
elseif ( $1 == .unjail ) {
if ($nick !isop #) {
msg # ( $+ $nick $+ ) $+ , You do not have the authority to do this
goto end
}
if ($readini(jail.ini,conf,stat)) {
if (!$readini(jailuser.ini, Jail, $2)) {
msg # The requested user ( $+ $2 $+ ) is not Jailed.
}
elseif ($readini(jailuser.ini, Jail, $2)) {
remini jailuser.ini jail $2-
;remini jailuser.ini jail $3
;remini jailuser.ini jail %user $+ timer
msg # The requested user ( $+ $2 $+ ) was unjailed.
}
else msg # Insufficient Parameters: .unjail 'The user that shall be unjailed' (Without quotes).
}
else msg # The jailing overview system is not enabled.
}
elseif ($nick !isop $chan) {
msg # ( $+ $nick $+ ), You do not have authority to do that action.
}
elseif ( $1 == .jailedusers ) {
if ($nick !isop #) {
msg # ( $+ $nick $+ ), You do not have the authority to do this
goto end
}
if ($nick isop #) { msg # There Are A Total Of ( $+ $ini(jailuser.ini, jail, 0) $+ ) Users in the Jailing system }
}
elseif ( $1 == .jailednicks ) {
if ($nick !isop $chan) {
msg # ( $+ $nick $+ ), You do not have authority to do that action.
goto end
}
var %j = $ini(jailuser.ini, jail, 0)
var %c = 1, %a = 1 $4-
msg # The Jailed User(s) Are:
while (%c <= %j) {
var %user = $ini(jailuser.ini, jail, %c)
var %time_left = Unspecified
if ($timer( $+(%user,unjailmsg) ) != $null) { var %time_left = $duration( $timer($+(%user,unjailmsg)).secs ) }
msg # $+($chr(35),%c,:) %user - %time_left - By: $gettok($readini(jailuser.ini ,jail, %user),1,32) $+ , Reason: $iif($gettok($readini(jailuser.ini, jail, %user),2-,32),$gettok($readini(jailuser.ini, jail, %user),2-,32),-NONE-)
inc %c
inc %a
}
msg # End Of List
}
elseif ($1 == .clear) {
if ($nick !isop $chan) {
msg # ( $+ $nick $+ ), You do not have authority to do that action.
goto end
}
msg # There were a total of $ini(jailuser.ini, jail, 0) users in the jailing system.
.remove jailuser.ini
msg # The jailing system was cleared.
}
:end
}
@ no_body21
var %time_left = Unspecified
if ($timer( $+(%user,unjailmsg) ) != $null) { var %time_left = $duration( $timer($+(%user,unjailmsg)).secs ) }
Unspecified then vars again?
could use only
%time_left = $duration( $timer($+(%user,unjailmsg)).secs
reason we setting the var twice, is if when the user is jailed, the jailer doesnt put a time to unjail, then it will remain Unspecified, if they did then itll replace Unspecifed with the time left for the jailed. :p
Look at the code. :D
Edit: Added the function to jail someone in minutes instead, since that was a bit mroe usfull for me.
So, incase you want to use minutes instead of seconds, change line (32) from (var %timer = $3) to (var %timer = $3 * 60) and line (34) from \'(\' ( $+ $duration($3) $+ ). \')\' to \'(\' ( $+ $duration(%timer,$3) $+ ). \')\'
You could just edit the snippet of yours...
else ($nick !isop $chan) { msg # You do not have authority to do that action. }
and
var %time_left = Unspecified
if ($timer( $+(%user,unjailmsg) ) != $null) { var %time_left = $duration( $timer($+(%user,unjailmsg)).secs ) }
Unspecified then vars again?
could use only
%time_left = $duration( $timer($+(%user,unjailmsg)).secs
5/10