This script is for Undernet irc network
For this script to work properly:
1) download X CService Control v1.6 which contains all the necessary files.
2) extract X folder in mIRC\scripts\
3) /load -rs scripts\x\startx.mrc
4) add X to Notify List
/notify on
/notify X
Is tested only on Undernet. I do not know if it's compatible with other networks CService.
startx.mrc
;a X CService Control v1.6 - [by Mi9] - 2016.09.09 - STARTX.MRC
;
; http://hawkee.com/snippet/17262/
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;
; Load script: /load -rs scripts/X/startx.mrc
;
; Commands:
; /ldx - load "X CService Control"
; /uldx - unload "X CService Control"
; /netcfg - change CService Name and Address
; /cd.sound - enable or disable sound connection
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;
CTCP *:VERSION:.ctcpreply $nick VERSION X CService Control v1.6 - [by Mi9] - http://hawkee.com/snippet/17262/
on 1:CONNECT:{
if ($readini(scripts/X/local,$network,netname) isin $server) {
echo 1,8 Connecting to $server
if ($network && $readini(scripts/X/local,$network,botname) == $null) netcfg
elseif ($readini(scripts/X/local,$network,autologin) == 1) echo 5 -s A U T O - L O G I N to $upper($network)
}
else netcfg
if ($readini(scripts/X/local,sound,status) == 1) splay -c scripts/X/connect.wav
}
on 1:DISCONNECT:{
if (%net.name isin $server && %bot.name != $null) {
.unload -rs %bot.name $+ .mrc
echo 1,8 Disconnected from $server
echo 4 -s *** $upper(%bot.name) CService Control UnLoaded
_unsetx
}
if ($readini(scripts/X/local,sound,status) == 1) splay -c scripts/X/disconnect.wav
}
;.......................................................................................
on 1:NICK:if ($nick == %bot.name) { set %bot.name $newnick | set %bot.login $newnick | set %net.xbot.cmd $newnick &CService Control }
on ^1:NOTICE:*:*:{
if ($nick == %bot.name) {
if ($window(@ $+ %bot.name) == $null) window -nk[0] @ $+ %bot.name
echo 5 @ $+ %bot.name - $+ $nick $+ - $1-
} halt
}
on 1:NOTIFY:{ if ($nick == $readini(scripts\X\local,$network,botname)) {
set %bot.name $readini(scripts\X\local,$network,botname) | set %bot.login %bot.name $+ $readini(scripts\X\local,$network,botlogin) | set %net.name $readini(scripts\X\local,$network,netname)
if ($script(%bot.name $+ .mrc) == $null) { .load -rs scripts\X\ $+ %bot.name $+ .mrc }
echo 12 -s *** $upper(%bot.name) CService Control Loaded | set %net.xbot.cmd $upper(%bot.name) &CService Control
if ($readini(scripts\X\local,$network,autologin) == 1) {
if ($readini(scripts\X\local,$network,mode+x) == 1) { .mode $me +x }
var %s.username $readini(scripts\X\local,$network,username), %s.userpass2 $readini(scripts\X\local,$network,userpass), %s.userpass $decode(%s.userpass2,m)
.msg %bot.login login %s.username $decode(%s.userpass)
}
}
}
on 1:UNOTIFY:{ if ($nick == %bot.name) { .unload -rs scripts/X/ $+ %bot.name $+ .mrc | echo 4 -s *** $upper(%bot.name) CService Control UnLoaded | _unsetx } }
dialog net.setup {
title "No connection detected"
icon scripts/X/cfg.ico, index
size -1 -1 250 161
box " Setup CService", 1, 5 5 240 120
text "CService Name: (Ex. X)", 2, 25 25 140 14
edit "", 3, 20 40 150 18, autohs limit 15 disable
text "CService Address: (Ex. @channels.undernet.org)", 5, 25 65 156 26
edit "", 6, 20 93 210 18, autohs limit 50 disable
button "&OK", 9, 142 132 50 24, ok default disable
button "&Cancel", 10, 196 132 50 24, cancel
text "by Mi9", 12, 20 138 85 14, disable
box "", 14, 5 128 60 29
icon 16, 187 26 48 48, scripts/X/net.png, style noborder
}
on 1:DIALOG:net.setup:*:*:{
if ($devent == init) {
if ($server && !$network) { dialog -t net.setup No network detected }
if ($network) { dialog -t net.setup Network name: $upper($network) | did -e net.setup 3,6,9
if ($readini(scripts/X/local,$network,botname) != $null) { did -a net.setup 3 $readini(scripts/X/local,$network,botname) }
if ($readini(scripts/X/local,$network,botlogin) != $null) did -a net.setup 6 $readini(scripts/X/local,$network,botlogin)
}
did -f net.setup 3
}
if ($devent == edit) { if ($did(3) != $null) && ($did(6) != $null) did -e net.setup 9 | else did -b net.setup 9 }
if ($devent == sclick) {
if ($did == 9) { writeini scripts/X/local $network botname $did(3)
writeini scripts/X/local $network botlogin $did(6) | writeini scripts/X/local $network netname $network
set %bot.name $did(3) | set %bot.login $did(6) | set %net.xbot.cmd $did(3) &CService Control
if ($notify == $false) .notify on
if ($notify(%bot.name) == $null) .notify -n %bot.name $network
}
if ($mouse.x isnum 5-64) && ($mouse.y isnum 128-157) run http://hawkee.com/profile/641249/?a=post&tt=snippet_id
}
}
on 1:LOAD:if ($server) && ($ini(scripts/X/local,$network) == $null) netcfg
alias cls clear
alias ldx { .load -rs scripts\X\x.mrc | echo 12 -s *** X CService Control Loaded }
alias uldx { .unload -rs scripts\X\x.mrc | _unsetx | echo 4 -s *** X CService Control UnLoaded }
alias netcfg dialog -m net.setup net.setup
alias cd.sound {
if ($readini(scripts/X/local,sound,status) == 1) { writeini scripts/X/local sound status 0 | echo -a 4:.: Notification sound for C/D is OFF }
elseif ($readini(scripts/X/local,sound,status) == 0) { writeini scripts/X/local sound status 1 | echo -a 3:.: Notification sound for C/D is ON }
else { writeini scripts/X/local sound status 1 | echo -a 3:.: Notification sound for C/D is ON }
}
alias _unsetx unset %net.* %bot.*
;z
x.mrc
;a X CService Control v1.6 - [by Mi9] - 2016.09.09 - X.MRC
;
; http://hawkee.com/snippet/17262/
;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;
on *:LOAD:{
if (%bot.name == $null || %bot.login == $null) {
set %bot.name $readini scripts/X/local $network botname | set %bot.login $readini scripts/X/local $network botlogin
set %net.name $readini scripts/X/local $network netname | set %net.xbot.cmd $upper(%bot.name) &CService Control
}
}
menu channel,status,menubar {
%net.xbot.cmd
.Channel Info [0]:.msg %bot.name chaninfo $ifact
.Status [1]:.msg %bot.name status $ifact
.Show Commands [0]:.msg %bot.name showcommands $ifact
.Verify nick... [0]:.msg %bot.name verify $$?="Verify <nick>"
.-
.Login to $upper(%bot.name) $+ ... [0]:logbot
.-
.Op Me [100]:.msg %bot.name op $ifact
.Deop Me [100]:.msg %bot.name deop $ifact
.Voice Me [25]:.msg %bot.name voice $ifact
.Devoice Me [25]:.msg %bot.name devoice $ifact
.-
.Topic... [50]:.msg %bot.name topic $ifact $$?="Give New <topic>"
.Invite... [100]:.msg %bot.name invite #$$?="Invite $crlf $+ <channel>"
.Bans
..Ban... [75]:.msg %bot.name ban $ifact $$?="Ban $crlf $+ <nick $chr(124) *!*user@*.host> [duration (1-2400h)] [level (1-500)] [reason]"
..UnBan... [75]:.msg %bot.name unban $ifact $$?="UnBan $crlf $+ <nick $chr(124) *!*user@*.host>"
..-
..List All $upper(%bot.name) Bans [0]:.msg %bot.name lbanlist $ifact *
..List $upper(%bot.name) Bans... [0]:.msg %bot.name lbanlist $ifact $$?="LBanList $crlf $+ <*!*user@*.host>"
..List Channel Ban [0]:.msg %bot.name banlist $ifact
.Users
..View User Info... [0]:.msg %bot.name INFO $$?="Info $crlf $+ <username>"
..View Access [0]
...All Users:.msg %bot.name access $ifact *
...User...:.msg %bot.name access $ifact $$?="Access $crlf $+ <username>"
...Min...:.msg %bot.name access $ifact -min $$?="Give the <min. level>"
...Max...:.msg %bot.name access $ifact -max $$?="Give the <max. level>"
...Op:.msg %bot.name access $ifact -op
...Voice:.msg %bot.name access $ifact -voice
...None:.msg %bot.name access $ifact -none
...Modified:.msg %bot.name access $ifact -modif
..-
..Suspend... [100]:.msg %bot.name suspend $ifact $$?="Suspend $crlf $+ <username> <duration M $chr(124) H $chr(124) D> [level] $crlf $+ Ex: al3x 5 M 250"
..Unsuspend... [100]:.msg %bot.name unsuspend $ifact $$?="Unsuspend $crlf $+ <username>"
..-
..Add User... [400]:.msg %bot.name adduser $ifact $$?="AddUser $crlf $+ <username> <level>"
..Remove User... [0-400]:.msg %bot.name remuser $ifact $$?="RemUser $crlf $+ <username>"
..Modif level... [400]:.msg %bot.name modinfo $ifact access $$?="ModInfo $crlf $+ <username> <level>"
..-
..Auto None... [400]:.msg %bot.name modinfo $ifact automode $?="None $crlf $+ <username>" none
..Auto Op... [400]:.msg %bot.name modinfo $ifact automode $$?="Op $crlf $+ <username>" op
..Auto Voice... [400]:.msg %bot.name modinfo $ifact automode $$?="Voice $crlf $+ <username>" voice
..-
..* Suspend Me [login]:.msg %bot.login suspendme $$?*="Suspend Me $crlf $+ NOTE: You will NOT be able to use your account after you issue this command. $crlf $+ Enter <your password>"
..-
..Invisible [login]
...On:.msg %bot.name set invisible on
...Off:.msg %bot.name set invisible off
..Language [login]
...Arabic:lng ar
...Catalan:lng ca
...Danish:lng dk
...Dutch:lng nl
...English:lng en
...French:lng fr
...German:lng de
...Hungarian:lng hu
...Italian:lng it
...Norwegian:lng no
...Portuguese:lng pt
...Romanian:lng ro
...Spanish:lng es
...Turkish:lng tr
.SET
..Description... [450]:.msg %bot.name set $ifact desc $$?="Description $crlf $+ <desc message>"
..Url... [450]:.msg %bot.name set $ifact url $$?="Url [url url2 ... urlN]"
..Auto Topic [450]
...On:.msg %bot.name set $ifact autotopic on
...Off:.msg %bot.name set $ifact autotopic off
..-
..Mass Deop Pro... [450]:.msg %bot.name set $ifact massdeoppro $$?="MassDeopPro $crlf $+ <value (0-7)>"
..Flood Protection... [450]:.msg %bot.name set $ifact floodpro $$?="FloodPro $crlf $+ <value (0-7)>"
..Floating Limit [450]
...FloatLim On/Off
....On:.msg %bot.name set $ifact floatlim on
....Off:.msg %bot.name set $ifact floatlim off
...FloatGrace...:.msg %bot.name set $ifact floatgrace $$?="FloatGrace $crlf $+ <value (0-19)>"
...FloatMargin...:.msg %bot.name set $ifact floatmargin $$?="FloatMArgin $crlf $+ <value (2-20)>"
...FloatMax...:.msg %bot.name set $ifact floatmax $$?="FloatMax $crlf $+ <value (0-n)>"
...FloatPeriod...:.msg %bot.name set $ifact floatperiod $$?="FloatPeriod $crlf $+ <value (20-200)>"
..NoOp [500]
...On:.msg %bot.name set $ifact noop on
...Off:.msg %bot.name set $ifact noop off
..StrictOp [500]
...On:.msg %bot.name set $ifact strictop on
...Off:.msg %bot.name set $ifact strictop off
..-
..Clear Mode [400]:.msg %bot.name clearmode $ifact
..Save Mode [450]:.msg %bot.name set $ifact mode
..Keywords... [450]:.msg %bot.name set $ifact keywords $$?="Give the <Keywords>"
..User Flag Mode [450]
...Auto None:.msg %bot.name set $ifact userflags 0
...Auto Op:.msg %bot.name set $ifact userflags 1
...Auto Voice:.msg %bot.name set $ifact userflags 2
..$upper(%bot.name) Auto Join [500]
...On:.msg %bot.name set $ifact autojoin on
...Off:.msg %bot.name set $ifact autojoin off
.Other
..-
..Search... [0]:.msg %bot.name search $$?="Search Channel Keywords $crlf $+ <parameter>"
..Show Ignore [0]:.msg %bot.name showignore
..MotD [0]:.msg %bot.name motd
..Support Channel [login]
...Yes:.msg %bot.name support $ifact yes
...No:.msg %bot.name support $ifact no
..-
..$upper(%bot.name) Join / Part
...$upper(%bot.name) Join [450]:.msg %bot.name join $ifact
...$upper(%bot.name) Part [500]:.msg %bot.name part $ifact
.-
.Help... [0]:.msg %bot.name help $$?="Help [command]"
.#Help @ Undernet.org:run http://help.undernet.org/
.Offline Help
..English:run scripts\X\xcmds-en.txt
..French:run scripts\X\xcmds-fr.txt
..Hungarian:run scripts\X\xcmds-hu.txt
..Italian:run scripts\X\xcmds-it.txt
..Norwegian:run scripts\X\xcmds-no.txt
..Romanian:run scripts\X\xcmds-ro.txt
..Spanish:run scripts\X\xcmds-es.txt
..Turkish:run scripts\X\xcmds-tr.txt
.$submenu($xcontrol($1))
}
menu nicklist {
%net.xbot.cmd
.OP [100]:.msg %bot.name op # $1
.Deop [100]:.msg %bot.name deop # $1
.-
.Voice [25]:.msg %bot.name voice # $1
.Devoive [25]:.msg %bot.name devoice # $1
.-
.Kick [50]:.msg %bot.name kick # $$1 $$?="Kick: $$1 $crlf $+ [reason]"
.Ban [75]:.msg %bot.name ban # $$1 $$?="Ban: $$1 $crlf $+ [duration (1-336h)] [level (1-500)] [reason]"
.Unban [75]:.msg %bot.name unban # $1
.-
.View User Access [0]:.msg %bot.name access $ifact = $+ $1
.View User Info [0]:.msg %bot.name INFO = $+ $1
.Verify [0]:.msg %bot.name verify $1
.-
.Suspend [100]:.msg %bot.name suspend $ifact = $+ $1 $$?="Suspend: $$1 - Ex: 5 m 250 $crlf $+ <duration M $chr(124) H $chr(124) D> [level]"
.UnSuspend [100]:.msg %bot.name unsuspend $ifact = $+ $1
}
alias logbot dialog -m log_in log_in
alias ifact { if ($active == $chan) return $active | else return #$$?="Enter <channel> $crlf $+ ex: radiocontact" }
alias lng msg %bot.name set lang $1
alias xcontrol {
if ($network) {
if ($1 == begin) return -
if ($1 == 1) return cService NewUser:run https://cservice.undernet.org/live/newuser.php
if ($1 == 2) return cService website:run https://cservice. $+ $lower(%net.name) $+ .org
if ($1 == 3) return www. $+ $lower(%net.name) $+ .org:run http://www. $+ $lower(%net.name) $+ .org
}
}
dialog log_in {
title ""
icon lock.ico, index
size -1 -1 250 196
box " My Account ", 1, 5 5 240 155
text "&Username:", 2, 20 35 50 14
edit "", 3, 80 32 150 18, autohs limit 25
text "&Password:", 4, 20 65 50 14
edit "", 5, 80 62 150 18, pass autohs limit 50
check "&Remember password", 6, 20 95 118 14
check "&Auto login", 7, 20 115 65 14
check "&Mode Me +X", 8, 20 135 123 14
button "&Login", 9, 142 168 50 23, ok default diasble
button "&Cancel", 10, 196 168 50 23, cancel
text "by Mi9", 12, 20 172 31 14, disable
box "", 14, 5 162 60 29
icon 15, 174 95 56 56, key.png, style noborder
icon 16, 70 169 20 20, settings.png, style noborder
}
on *:dialog:log_in:*:*:{
if ($devent == init) { dialog -t log_in Login to $upper($network) CService
var %s.username $readini(scripts/X/local,$network,username)
var %s.userpass2 $readini(scripts/X/local,$network,userpass)
if ( %s.username != $null ) { did -a log_in 3 %s.username }
if ( %s.userpass2 != $null ) { var %s.userpass $decode(%s.userpass2,m) | did -a log_in 5 $decode(%s.userpass) }
if ($readini(scripts/X/local,$network,remember) == 1) { did -c log_in 6 } | else { did -u log_in 6 }
if ($readini(scripts/X/local,$network,autologin) == 1) { did -c log_in 7 } | else { did -u log_in 7 }
if ($readini(scripts/X/local,$network,mode+x) == 1) { did -c log_in 8 } | else { did -u log_in 8 }
if ($did(3) != $null) || ($did(5) != $null) { did -e log_in 9 } | else { did -b log_in 9 }
}
if ($devent == edit) {
if ($did(3) != $null) && ($did(5) != $null) && ($len($did(5)) > 7) { did -e log_in 9 } | else { did -b log_in 9 }
}
if ($devent == sclick) {
if ($did == 6) { did -u log_in 7 | writeini scripts/X/local $network autologin 0
writeini scripts/X/local $network remember $did(6).state
if ($did(6).state == 0) { remini scripts/X/local $network userpass }
}
if ($did == 7) { did -c log_in 6 | writeini scripts/X/local $network remember 1
writeini scripts/X/local $network autologin $did(7).state
}
if ($did == 8) writeini scripts/X/local $network mode+x $did(8).state
if ($did == 9) {
writeini scripts/X/local $network UserName $did(3)
if ($did(6).state) { var %s.userpass $did(5) | var %s.userpass2 $encode(%s.userpass) | writeini scripts/X/local $network userpass $encode(%s.userpass2,m) }
else { .remini scripts/X/local $network userass }
if ($readini(scripts/X/local,$network,mode+x) == 1) { .mode $me +x | .msg %bot.login login $did(3) $did(5) }
}
if ($did == 16) { netcfg }
if ($mouse.x isnum 5-64) && ($mouse.y isnum 169-188) run http://hawkee.com/profile/641249/?a=post&tt=snippet_id
}
}
;z
Add X to Notify List:
/notify on
/notify X
Or you can load manualy with: /ldx