"
$text = "privmsg " & $chatto & " :ACTION " & $text & ""
Return
EndIf
; ------------ on /msg----------
If StringInStr($text, "msg") = 1 Then
$msgt = StringMid($text, 5)
$msgsp=stringinstr($msgt," ")
$msgn=stringleft($msgt, $msgsp-1)
$msgt=stringmid($msgt, $msgsp+1)
$dtext = $newnick & " ->" & $msgn & ": " & $msgt
$text = "privmsg " & $msgn & " :" & $msgt
Return
EndIf
; ------------ on CTCP ----------
If StringInStr($text, "ctcp") = 1 Then
$ctcpp2 = StringInStr($text, " ", 0, 2) ; find the 2st space
$ctcpr = StringMid($text, 5, $ctcpp2 - 5) ; Find name, get rid of ctcp and go up to first space
$ctcpc = StringMid($text, $ctcpp2) ; command text from end of name (2nd space)
$ctcpr = StringStripWS($ctcpr, 3)
$ctcpc = StringStripWS($ctcpc, 3)
$ctcpe = ""
If $ctcpr = "" Then $ctcpe = "No name"
If $ctcpc = "" Then $ctcpe &= " No command"
If Not $ctcpe = "" Then
$sendtext=0
$dtext = $text & " is not a properly formated command (()" & $ctcpe & "())" & @CRLF & _
"Name: " & $ctcpr & " (" & $ctcpp1 & ") " & " Command: " & $ctcpc & " (" & $ctcpp2 & ") " & @CRLF & _
"Type /CTCP name command"
Return
EndIf
; PRIVMSG #adam1213 :command
$showtext=1
$dtext = $newnick & ": CTPC " & $ctcpr & ": " & $ctcpc
$text = "privmsg " & $ctcpr & " :" & $ctcpc & ""
Return
EndIf
; ------------ on version ----------
If StringInStr($text, "version") = 1 Then
;/privmsg user :VERSION
$text = StringMid($text, 9)
$dtext = $newnick & " : Requesting version: " & $text
$text = "privmsg " & $text & " :VERSION"
; NOTICE Adam1213-temp :VERSION client
Return
EndIf
; ------------ on quote ----------
If StringInStr($text, "quote") = 1 Then
$com = StringMid($text, 7)
$text = $com
$dtext = ">COMMAND " & $com
Return
EndIf
; ------------ on ns ----------
If StringInStr($text, "ns ") = 1 Then
$com = StringMid($text, 4)
$text = "privmsg nickserv :" & $com
$dtext = "-> nickserv :" & $com
Return
EndIf
; ------------ on nickserv ----------
If StringInStr($text, "nickserv ") = 1 Then
$com = StringMid($text, 9)
$text = "privmsg nickserv :" & $com
$dtext = "-> nickserv :" & $com
Return
EndIf
; ------------ on cs ----------
If StringInStr($text, "cs ") = 1 Then
$com = StringMid($text, 3)
$text = "privmsg chanserv :" & $com
$dtext = ">chanserv :" & $com
Return
EndIf
; ------------ on chanserv ----------
If StringInStr($text, "chanserv ") = 1 Then
$com = StringMid($text, 9)
$text = "privmsg chanserv :" & $com
$dtext = ">chanserv :" & $com
Return
EndIf
; ------------ on as ----------
If StringInStr($text, "op ") = 1 Then
$com = StringMid($text, 3)
$text = "privmsg operserv :" & $com
$dtext = ">adminserv :" & $com
Return
EndIf
; ------------ on chanserv ----------
If StringInStr($text, "adminserv ") = 1 Then
$com = StringMid($text, 9)
$text = "privmsg adminserv :" & $com
$dtext = ">adminserv :" & $com
Return
EndIf
EndFunc ;==>oncommands
;====================================================================================================================
;func onroomtimer()
; $roomtimerwait=0
; onsend("0-onroomtimer")
;endfunc ; ==>onroomtimer
; ----------- on exit ------------------
Func OnExit()
Onsaveinfo()
onexit2()
$exit = "yes"
Exit
EndFunc ;==>OnExit
; -------------- on first ping ----------------------
Func onfping()
$fping = $fping + 1
Sleep(100)
TCPSend($socket, @CRLF & "nick " & $nick & @CRLF)
Sleep(2)
TCPSend($socket, @CRLF & "privmsg nickserv :identify " & $password & @CRLF)
Sleep(1000)
TCPSend($socket, "join " & $joinf & @CRLF)
$roomtimerwait=1
$roomtimer = TimerInit()
$namesrequest = "no"
Sleep(1)
EndFunc ;==>onfping
;_______________ ON ENTER ________________________________________________________
Func EnterSends()
If WinActive($IRCGUIW) Then
;----------------- Window is active ------------------------------------------------
If $connected = "no" And StringInStr(StringStripWS(GUICtrlRead($chat12), 3), "/") <> 1 Then
onconnect()
Return
Else
$state2 = ControlGetFocus("") ; GUICtrlGetState ($chat12)
GUICtrlGetState ($chat12)
ControlFocus($IRCGUIW, "", $chat12)
; GUICtrlSetState($IRCGUIW, $GUI_FOCUS)
If $state2 <> $chat12s Then Return
If StringStripWS(GUICtrlRead($chat12), 3) = "" Then Return
onsend()
EndIf
; ------------- If not active ---------
Else
HotKeySet("{Enter}");un-register hotkey
Send("{enter}")
HotKeySet("{Enter}", "EnterSends");register hotkey
EndIf
EndFunc ;==>EnterSends
; ----------------------- help ----------------
Func onhelp()
Run(@ComSpec & " /c cd" & $path & "& Start " & $helpfile)
EndFunc ;==>onhelp
; ------------- change password -----------
Func onpassword()
$connectatstart = "no"
$tpass = InputBox("Password", "Password", "", "*", 300, 100)
If @error = 1 Then Return ; 1 = The Cancel button was pushed.
If $tpass = "" Then Return
$password = $tpass
$epassword = $passad & _StringEncrypt(1, $password, $pass2, $level)
RegWrite($regplace, "6 Password", "REG_SZ", $epassword)
EndFunc ;==>onpassword
Func onsettings()
If $msgboxm = "on" Then
$sssDSIRCPOPUP = 1
Else
$sssDSIRCPOPUP = 4
EndIf
If $traym = "on" Then
$sssDSIRCtray = 1
Else
$sssDSIRCtray = 4
EndIf
;----------- Raw --------------------
If $raw = "on" Then
$sssDSIRCRAWIRC = 1
Else
$sssDSIRCRAWIRC = 4
EndIf
;----------- scroll --------------------
If $scroll = "yes" Then
$ssssdscroll = 1
Else
$ssssdscroll = 4
EndIf
opt("GUICloseOnESC", 1) ;1=ESC closes, 0=ESC won't close
$server = GUICtrlRead($vserver)
Global $connectatstart = "no"
GUISetState(@SW_DISABLE, $IRCGUIW)
; == GUI generated with Koda ==
global $gui22 = GUICreate("Settings", 353, 407, 228, 117)
GUISetIcon("Images\cog.ico")
GUICtrlCreateLabel("Settings", 88, 8, 91, 33, $WS_CLIPSIBLINGS)
GUICtrlSetFont(-1, 18, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFFFF00)
global $sssSettings = GUICtrlCreateTab(16, 48, 321, 321, $TCS_HOTTRACK)
global $sssDisplay = GUICtrlCreateTabItem(" Display ")
global $sssSDIRCG = GUICtrlCreateGroup("IRC", 28, 176, 297, 185)
global $sssGroup4 = GUICtrlCreateGroup("Other", 36, 280, 281, 73)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUICtrlSetTip(-1, "IRC")
global $sssGroup2 = GUICtrlCreateGroup("Message Recieved", 36, 192, 281, 81)
GUICtrlCreateGroup("", -99, -99, 1, 1)
global $sssGroup1 = GUICtrlCreateGroup("Chat Log", 28, 80, 297, 89)
global $ssssdtextcolour = GUICtrlCreateButton("Text &colour", 36, 104, 81, 17)
GUICtrlSetTip(-1, "Change the text colour")
GUICtrlSetCursor($ssssdtextcolour, 0)
global $ssssdfont = GUICtrlCreateButton("&Font", 124, 104, 81, 17)
GUICtrlSetTip(-1, "Change the font")
GUICtrlSetCursor($ssssdfont, 0)
global $ssssdbgcolour = GUICtrlCreateButton("&Background Colour", 212, 104, 105, 17)
GUICtrlSetTip(-1, "Change the background colour")
GUICtrlSetCursor($ssssdbgcolour, 0)
global $gssssdscroll = GUICtrlCreateCheckbox("&Auto Scroll", 44, 128, 81, 17)
GUICtrlSetState(-1, $ssssdscroll)
GUICtrlSetTip(-1, "Automaticaly scroll down")
global $gssssdwordwrap = GUICtrlCreateCheckbox("&Word Wrap", 44, 144, 81, 17)
GUICtrlSetState(-1, $ssssdwordwrap)
GUICtrlSetTip(-1, "Word wrap")
GUICtrlCreateGroup("", -99, -99, 1, 1)
global $gsssDSIRCRAWIRC = GUICtrlCreateCheckbox("&Raw IRC", 52, 296, 65, 17)
GUICtrlSetState(-1, $sssDSIRCRAWIRC)
GUICtrlSetTip(-1, "Raw IRC")
global $gsssDSIRCtray = GUICtrlCreateCheckbox("&Tray Alerts", 52, 328, 121, 17)
GUICtrlSetState(-1, $sssDSIRCtray)
GUICtrlSetTip(-1, "Tray messages when command is sent")
global $gsssDSIRCPOPUP = GUICtrlCreateCheckbox("&Pop up Messages", 52, 312, 121, 17)
GUICtrlSetState(-1, $sssDSIRCPOPUP)
GUICtrlSetTip(-1, "Pop up messages when command is sent")
global $gsssDSIRCFlash = GUICtrlCreateCheckbox("Flash", 52, 216, 49, 17)
GUICtrlSetState(-1, $sssDSIRCFlash)
GUICtrlSetTip(-1, "Flash every time a message is recieved")
global $gsssDSIRCSound = GUICtrlCreateCheckbox("Sound", 52, 236, 57, 17)
GUICtrlSetState(-1, $sssDSIRCSound)
GUICtrlSetTip(-1, "Play a sound every time a message is recieved")
GUICtrlCreateLabel("Times:", 108, 217, 41, 17)
global $gsssSDIRCMRtimes = GUICtrlCreateInput($sssSDIRCMRtimes, 140, 217, 19, 17, -1, $WS_EX_CLIENTEDGE + $ES_NUMBER)
GUICtrlSetLimit($gsssSDIRCMRtimes, 2)
GUICtrlSetTip(-1, "Number of times to flash when a message is recived")
GUICtrlSetCursor($gsssSDIRCMRtimes, 5)
global $gsssSDIRCMRdelay = GUICtrlCreateInput($sssSDIRCMRdelay, 196, 217, 33, 17, -1, $WS_EX_CLIENTEDGE + $ES_NUMBER)
GUICtrlSetLimit($gsssSDIRCMRdelay, 4)
GUICtrlSetTip(-1, "Delay between flashes")
GUICtrlSetCursor($gsssSDIRCMRdelay, 5)
GUICtrlCreateLabel("Delay:", 164, 217, 34, 17)
global $ssss2oundfile = GUICtrlCreateButton("File", 108, 236, 57, 17)
GUICtrlSetCursor ($ssss2oundfile, 0)
global $gsssSDIRMRnickalert = GUICtrlCreateCheckbox("&Nick Alert", 52, 252, 73, 17)
GUICtrlSetState(-1, $sssSDIRMRnickalert)
GUICtrlSetTip(-1, "Tray message when someone says your nickname")
GUICtrlSetTip(-1, "Display settings")
GUICtrlSetCursor($sssDisplay, 0)
global $sssconnecttab = GUICtrlCreateTabItem(" Connection ")
global $sssGroup3 = GUICtrlCreateGroup("Server", 28, 80, 297, 73)
global $gsssSCServer = GUICtrlCreateCombo("", 72, 96, 201, 21)
GUICtrlSetData($gsssSCServer, "nsw-chat.bigpond.com|irc.freenode.net", $server)
GUICtrlSetTip(-1, "Server")
GUICtrlSetCursor($gsssSCServer, 5)
GUICtrlCreateLabel("Server:", 32, 104, 38, 17)
GUICtrlCreateLabel("Port:", 40, 128, 26, 17)
global $gsssSCport = GUICtrlCreateInput($sssSCport, 72, 128, 41, 17, -1, $WS_EX_CLIENTEDGE + $ES_NUMBER)
GUICtrlSetLimit($gsssSCport, 5)
GUICtrlSetTip(-1, "Port")
GUICtrlSetCursor($gsssSCport, 5)
global $sssSCsadd = GUICtrlCreateButton("A&dd", 280, 96, 33, 17)
GUICtrlSetTip(-1, "Add another server")
GUICtrlSetCursor($sssSCsadd, 0)
GUICtrlCreateGroup("", -99, -99, 1, 1)
global $gsssscac = GUICtrlCreateCheckbox("Auto &connect", 32, 168, 89, 17)
GUICtrlSetState(-1, $sssscac)
GUICtrlCreateLabel("Delay:", 128, 168, 34, 17)
global $gSsssCD = GUICtrlCreateInput($sssSCD, 160, 168, 25, 17, -1, $WS_EX_CLIENTEDGE + $ES_NUMBER)
GUICtrlSetLimit($gsssSCD, 3)
GUICtrlSetTip(-1, "Time until it automaticaly connects (in seconds)")
GUICtrlSetCursor($gsssSCD, 5)
GUICtrlSetTip(-1, "Connection")
GUICtrlSetCursor($sssconnecttab, 0)
global $sssTabSheet2 = GUICtrlCreateTabItem(" Other ")
global $sssGroup5 = GUICtrlCreateGroup("Log", 28, 88, 297, 41)
global $gsssSOlog = GUICtrlCreateCheckbox("Log chat", 40, 104, 65, 17)
GUICtrlSetState(-1, $sssSOlog)
GUICtrlSetTip(-1, "Log chat")
GUICtrlCreateGroup("", -99, -99, 1, 1)
global $sssrestoredefault = GUICtrlCreateButton("Restore defaults", 32, 136, 89, 25)
GUICtrlSetCursor($sssTabSheet2, 0)
GUICtrlCreateTabItem("")
GUICtrlSetCursor($sssSettings, 0)
global $sssSSsave = GUICtrlCreateButton("&Save", 16, 376, 241, 25)
GUICtrlSetTip(-1, "Save settings")
GUICtrlSetCursor($sssSSsave, 0)
GUICtrlSetOnEvent($sssSSsave, "onsavesettings")
global $sssSSdiscard = GUICtrlCreateButton("Discard", 256, 376, 81, 25)
GUICtrlSetOnEvent($sssSSdiscard, "Onsettingsclose")
GUICtrlSetTip(-1, "Discard settings")
GUICtrlSetCursor($sssSSdiscard, 0)
global $sssPic1 = GUICtrlCreatePic("Images\settings_ico.bmp", 184, 8, 41, 41)
GUICtrlSetOnEvent($sssrestoredefault, "Onrestore")
GUICtrlSetOnEvent($ssssdbgcolour, "onbackcolourchange")
GUICtrlSetOnEvent($ssssdtextcolour, "ontextcolourchange")
GUICtrlSetOnEvent($ssssdfont, "onfont")
GUICtrlSetOnEvent($ssss2oundfile, "onsoundfile")
;GUICtrlSetState ($gssssdscroll,$ssssdscroll); checkbox
;GUICtrlSetState ($gssssdwordwrap,$ssssdwordwrap); checkbox
;GUICtrlSetState ($gsssDSIRCRAWIRC,$sssDSIRCRAWIRC); checkbox
;GUICtrlSetState ($gsssDSIRCtray,$sssDSIRCtray); checkbox
;GUICtrlSetState ($gsssDSIRCPOPUP,$sssDSIRCPOPUP); checkbox
;GUICtrlSetState ($gsssDSIRCFlash,$sssDSIRCFlash); checkbox
;GUICtrlSetState ($gsssDSIRCSound,$sssDSIRCSound); checkbox
;GUICtrlSetState ($gsssSDIRMRnickalert,$sssSDIRMRnickalert); checkbox
;GUICtrlSetState ($gsssscac,$sssscac); checkbox
;GUICtrlSetState ($gsssSOlog,$sssSOlog); checkbox
;GUICtrlSetData ($sssSDIRCMRtimes,$sssSDIRCMRtimes); input
;GUICtrlSetData ($sssSDIRCMRdelay,$sssSDIRCMRdelay); input
;GUICtrlSetData ($sssSCport,$sssSCport); input
;GUICtrlSetData ($sssSCD,$sssSCD); input
;GUICtrlSetData($gsssSCServer, $sssSCServer); Combo
GUISetOnEvent($GUI_EVENT_CLOSE, "Onsettingsask", $gui22)
GUISwitch($gui22)
GUISetState()
;hotkeyset ("^{f3}","oncoonecttab")
endfunc ()
; -------------------- Onsettingsask -----------------------
Func Onsettingsask()
$save1 = MsgBox(32 + 3, "Save", "Save settings?") ; returns | 6 - yes | 7 - no |-1 timed out
If $save1 = 6 Then onsavesettings() ; yes
If $save1 = 7 Then Onsettingsclose(); no
;If $save1 = 2 Then return ; cancel
EndFunc ;==>Onsettingsask
; ------------------ Save settings --------------
Func onsavesettings()
; ================== Read GUI CTRL ====================================
$ssssdscroll = GUICtrlRead($gssssdscroll); "&Auto Scroll" - 1 checked, 4 not checked checkbox
$ssssdwordwrap = GUICtrlRead($gssssdwordwrap); "&Word Wrap" - 1 checked, 4 not checked checkbox
$sssDSIRCRAWIRC = GUICtrlRead($gsssDSIRCRAWIRC); "&Raw IRC" - 1 checked, 4 not checked checkbox
$sssDSIRCtray = GUICtrlRead($gsssDSIRCtray); "&Tray Alerts" - 1 checked, 4 not checked checkbox
$sssDSIRCPOPUP = GUICtrlRead($gsssDSIRCPOPUP); "&Pop up Messages" - 1 checked, 4 not checked checkbox
$sssDSIRCFlash = GUICtrlRead($gsssDSIRCFlash); "Flash" - 1 checked, 4 not checked checkbox
$sssDSIRCSound = GUICtrlRead($gsssDSIRCSound); "Sound" - 1 checked, 4 not checked checkbox
$sssSDIRMRnickalert = GUICtrlRead($gsssSDIRMRnickalert); "&Nick Alert" - 1 checked, 4 not checked checkbox
$sssscac = GUICtrlRead($gsssscac); "&Auto connect" - 1 checked, 4 not checked checkbox
$sssSOlog = GUICtrlRead($gsssSOlog); "Log chat" - 1 checked, 4 not checked checkbox
$sssSDIRCMRtimes = GUICtrlRead($gsssSDIRCMRtimes); "" - input
$sssSDIRCMRdelay = GUICtrlRead($gsssSDIRCMRdelay); "" - input
$sssSCport = GUICtrlRead($gsssSCport); "6667" - input
$sssSCD = GUICtrlRead($gsssSCD); "3" - input
$sssSCServer = GUICtrlRead($gsssSCServer); "" - Combo
;if $gsssscac=1 then
$port = $sssSCport
;----------- Msgbox --------------------
If $sssDSIRCPOPUP = 1 Then
$msgboxm = "on"
Else
$msgboxm = "off"
EndIf
;----------- Tray --------------------
If $sssDSIRCtray = 1 Then
$traym = "on"
Else
$traym = "off"
EndIf
;----------- Raw --------------------
If $sssDSIRCRAWIRC = 1 Then
$raw = "on"
Else
$raw = "off"
EndIf
;----------- scroll --------------------
If $ssssdscroll = 1 Then
$scroll = "yes"
Else
$scroll = "no"
EndIf
$nn = 22
; _GUICtrlComboGetLBText($gsssSCServer, $nn, ByRef $s_text)
; $gsssSCServer2=
; _GUICtrlComboResetContent($vserver)
;GUICtrlSetData($vserver, "", $sssSCServer)
; "nsw-chat.bigpond.com|irc.freenode.net", $server)
Onsaveinfo()
Onsettingsclose()
EndFunc ;==>onsavesettings
; ----------------delete ------------
Func ondelete()
$dname = StringStripWS($rrname, 3)
If StringInStr($dname, "@") Or StringInStr($dname, "+") Then $dname = StringMid($dname, 2)
$delindex = _GUICtrlListFindString ($userlist, $dname, 1)
If ($delindex == $LB_ERR) Then $delindex = _GUICtrlListFindString ($userlist, "@" & $dname, 1)
If ($delindex == $LB_ERR) Then $delindex = _GUICtrlListFindString ($userlist, "+" & $dname, 1)
If NOT ($delindex == $LB_ERR) Then _GUICtrlListDeleteItem ($userlist, $delindex)
EndFunc ;==>ondelete
; ------------- settings close ---------------------
Func Onsettingsclose()
opt("GUICloseOnESC", 0) ;1=ESC closes, 0=ESC won't close
GUISwitch($IRCGUIW)
GUISetState(@SW_ENABLE, $IRCGUIW)
GUIDelete($gui22)
EndFunc ;==>Onsettingsclose
; ------------- Save info ---------------------
Func Onsaveinfo()
$nick = GUICtrlRead($vnick1e)
$server = GUICtrlRead($vserver)
;$port = GUICtrlRead($vPorte)
RegWrite($regplace, "1 Nick", "REG_SZ", $nick)
;RegWrite($regplace, "2 Name", "REG_SZ", $name)
RegWrite($regplace, "4 Server", "REG_SZ", $server)
;RegWrite($regplace, "5 Port", "REG_SZ", $port)
RegWrite($regplace, "7 Save on exit", "REG_SZ", $save)
; ---------------- ini settings -------------------------
IniWrite($settingsplace, "Display \ chat log", "Chat Background Colour", $bcolour)
IniWrite($settingsplace, "Display \ chat log", "Chat Text Colour", $tcolour)
IniWrite($settingsplace, "Display \ chat log", "Text Size", $fsize )
IniWrite($settingsplace, "Display \ chat log", "Text Weight", $fweight )
IniWrite($settingsplace, "Display \ chat log", "Text Attribute", $fattribute )
IniWrite($settingsplace, "Display \ chat log", "Text Font", $fontname)
; ======================= Settings =============================================
IniWrite($settingsplace, "Settings", 'Auto scroll', $ssssdscroll)
IniWrite($settingsplace, "Settings", 'Raw IRC', $sssDSIRCRAWIRC)
IniWrite($settingsplace, "Settings", 'Word wrap', $ssssdwordwrap)
IniWrite($settingsplace, "Settings", 'Tray icon', $sssDSIRCtray)
IniWrite($settingsplace, "Settings", 'Pop up', $sssDSIRCPOPUP)
IniWrite($settingsplace, "Settings", 'Flash', $sssDSIRCFlash)
IniWrite($settingsplace, "Settings", 'Sound', $sssDSIRCSound)
IniWrite($settingsplace, "Settings", 'Sound file', $ssssdsoundfile)
IniWrite($settingsplace, "Settings", "sssSDIRMRnickalert", $sssSDIRMRnickalert)
IniWrite($settingsplace, "Settings", "sssscac", $sssscac)
IniWrite($settingsplace, "Settings", "sssSOlog", $sssSOlog)
IniWrite($settingsplace, "Settings", "sssSDIRCMRtimes", $sssSDIRCMRtimes)
IniWrite($settingsplace, "Settings", "sssSDIRCMRdelay", $sssSDIRCMRdelay)
IniWrite($settingsplace, "Settings", "sssSCport", $sssSCport)
IniWrite($settingsplace, "Settings", "sssSCD", $sssSCD)
IniWrite($settingsplace, "Settings", "sssSCServer", $sssSCServer)
IniWrite($settingsplace, "Settings", "ssslog", $ssslog)
EndFunc ;==>Onsaveinfo
; --------------- on restore ---------------------------------
Func onrestore()
$save1 = MsgBox(32 + 4, "Restore Defaults?", "Are you sure that you want to restore the default settings?") ; returns | 6 - yes | 7 - no |-1 timed out
If $save1 = 7 Then Return; no
ondefaults()
GUICtrlSetState($gssssdscroll, $ssssdscroll); checkbox
GUICtrlSetState($gssssdwordwrap, $ssssdwordwrap); checkbox
GUICtrlSetState($gsssDSIRCRAWIRC, $sssDSIRCRAWIRC); checkbox
GUICtrlSetState($gsssDSIRCtray, $sssDSIRCtray); checkbox
GUICtrlSetState($gsssDSIRCPOPUP, $sssDSIRCPOPUP); checkbox
GUICtrlSetState($gsssDSIRCFlash, $sssDSIRCFlash); checkbox
GUICtrlSetState($gsssDSIRCSound, $sssDSIRCSound); checkbox
GUICtrlSetState($gsssSDIRMRnickalert, $sssSDIRMRnickalert); checkbox
GUICtrlSetState($gsssscac, $sssscac); checkbox
GUICtrlSetState($gsssSOlog, $sssSOlog); checkbox
GUICtrlSetData($gsssSDIRCMRtimes, $sssSDIRCMRtimes); input
GUICtrlSetData($gsssSDIRCMRdelay, $sssSDIRCMRdelay); input
GUICtrlSetData($gsssSCport, $sssSCport); input
GUICtrlSetData($gsssSCD, $sssSCD);
GUICtrlSetFont($Edit_10, $fsize, $fweight, $fattribute, $fontname)
GUICtrlSetBkColor($Edit_10, $bcolour)
GUICtrlSetColor($Edit_10, $tcolour)
EndFunc ;==>onrestore
; ======================= on Defaults =============================================
Func ondefaults()
Global $ssssdscroll = $GUI_CHECKED ; checkbox at 737
Global $ssssdwordwrap = $GUI_UNCHECKED; checkbox at 740
Global $sssDSIRCRAWIRC = $GUI_UNCHECKED; checkbox at 743
Global $sssDSIRCtray = $GUI_CHECKED ; checkbox at 745
Global $sssDSIRCPOPUP = $GUI_CHECKED ; checkbox at 748
Global $sssDSIRCFlash = $GUI_UNCHECKED; checkbox at 751
Global $sssDSIRCSound = $GUI_CHECKED; checkbox at 753
Global $sssSDIRMRnickalert = $GUI_CHECKED ; checkbox at 767
Global $sssscac = $GUI_UNCHECKED; checkbox at 788
Global $sssSOlog = $GUI_CHECKED ; checkbox at 798
Global $sssSDIRCMRtimes = "" ; input at 756
Global $sssSDIRCMRdelay = "10" ; input at 760
Global $sssSCport = "6667" ; input at 780
Global $sssSCD = "3" ; input at 790
Global $sssSCServer = "" ; Combo at 774
Global $ssslog = 1
Global $ssssdsoundfile = $path & "\chat-inbound.wav"
$bcolour = "0xFFFFFF" ; white is the default
$tcolour = "0x000000" ; black is the default
Global $fattribute = ""
Global $fontname = ""
Global $fsize = ""
Global $fweight = ""
EndFunc ;==>ondefaults
;----------------- chat log Change background colour---------
Func onbackcolourchange()
$bcolour = _ChooseColor (2, $bcolour, 2)
;If (@error) Then
GUICtrlSetBkColor($Edit_10, $bcolour)
;endif
EndFunc ;==>onbackcolourchange
;----------------- chat log change text colour---------
Func ontextcolourchange()
$tcolour = _ChooseColor (2, $tcolour, 2)
;If (@error) Then
GUICtrlSetColor($Edit_10, $tcolour)
;endif
EndFunc ;==>ontextcolourchange
;-------------- Change chat log font --------------------
Func onfont()
$fontinfo = _ChooseFont ($fontname, $fsize, 1)
;If (@error) Then
$fattribute = $fontinfo[1]
$fontname = $fontinfo[2]
$fsize = $fontinfo[3]
$fweight = $fontinfo[4]
;$fcolour = $fontinfo[5]
GUICtrlSetFont($Edit_10, $fsize, $fweight, $fattribute, $fontname)
;endif
EndFunc ;==>onfont
Func oncoonecttab()
_GUICtrlTabSetCurFocus ($sssSettings,2)
EndFunc ;==>oncoonecttab
;------------------------------ on sound file ----------------------------------------
func onsoundfile()
$ssssdsoundfile = FileOpenDialog ("Recieve message sound", $path, "Wav files (*.wav)" , 1 , $ssssdsoundfile)
endfunc
; --------------------------------- on exit ---------------------------------
Func onexit2()
TCPSend($socket, "QUIT :" & $quitreason & @CRLF) ; Send to the IRC server that you have quit and a quit reason
Sleep(100)
If $ssslog = 1 Then
$filedest=$path & "\Logs\" & $chatto & ".html"
$file2=FileOpen ($filedest,9)
Filewrite($file2,FileRead ("log.html"))
fileclose($file2)
;FileListToArray($path & "\log" [, $sFilter [, $iFlag]])
endif
If $lastplacechanged = "yes" Then RegWrite($regplace2, "LastKey", "REG_SZ", $lastkey)
Global $save = RegRead($regplace, "7 Save on exit")
If "t" & $save = "t" Then
$save = "yes"
RegWrite($regplace, "7 Save on exit", "REG_SZ", $save)
EndIf
If $save = "no" Then Return
If $save > "-1" And $save < "1000" And $save <> "yes" Then
$save1 = MsgBox(4, "Save", "Save settings?", $save) ; returns | 6 - yes | 7 - no |-1 timed out
If $save1 > 6 Then Return
EndIf
onsaveinfo()
EndFunc ;==>onexit2
; Show a menu in a given GUI window which belongs to a given GUI ctrl
Func ShowMenu($hWnd, $CtrlID, $nContextID)
Local $hMenu = GUICtrlGetHandle ($nContextID)
$arPos2 = ControlGetPos($hWnd, "", $CtrlID)
$arpos = MouseGetPos()
;msgbox(0,"",$arpos [1] & " - " & $arpos2 [1])
Local $x = $arpos[0]
Local $y = $arpos[1] - 50
ClientToScreen($hWnd, $x, $y)
TrackPopupMenu($hWnd, $hMenu, $x, $y)
EndFunc ;==>ShowMenu
; Convert the client (GUI) coordinates to screen (desktop) coordinates
Func ClientToScreen($hWnd, ByRef $x, ByRef $y)
Local $stPoint = DllStructCreate("int;int")
DllStructSetData($stPoint, 1, $x)
DllStructSetData($stPoint, 2, $y)
DllCall("user32.dll", "int", "ClientToScreen", "hwnd", $hWnd, "ptr", DllStructGetPtr($stPoint))
$x = DllStructGetData($stPoint, 1)
$y = DllStructGetData($stPoint, 2)
; release Struct not really needed as it is a local
$stPoint = 0
EndFunc ;==>ClientToScreen
; Show at the given coordinates (x, y) the popup menu (hMenu) which belongs to a given GUI window (hWnd)
Func TrackPopupMenu($hWnd, $hMenu, $x, $y)
DllCall("user32.dll", "int", "TrackPopupMenuEx", "hwnd", $hMenu, "int", 0, "int", $x, "int", $y, "hwnd", $hWnd, "ptr", 0)
EndFunc ;==>TrackPopupMenu
;====================== ABOUT GUI ===============
Func onabout()
onlines()
GUISetState(@SW_DISABLE, $IRCGUIW)
opt("GUICloseOnESC", 1) ;1=ESC closes, 0=ESC won't close
; == GUI generated with Koda ==
Global $AboutGUI = GUICreate("About", 456, 259, 302, 218, $WS_CLIPSIBLINGS); $DS_CONTEXTHELP
$GroupBox1 = GUICtrlCreateGroup("", 8, 8, 435, 185)
GUICtrlCreatePic($path & "\autoit.jpg", 16, 24, 105, 97)
GUICtrlCreateLabel("Adam1213's IRC Client", 152, 16, 139, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFFFF00)
GUICtrlCreateLabel("Version: " & $version, 152, 40, 98, 17)
GUICtrlCreateLabel("Release Date: " & $releasedate, 152, 56, 144, 17)
GUICtrlCreateLabel("Lines: " & $lines, 152, 72, 80, 17)
GUICtrlCreateLabel("Pages: " & $pages, 152, 88, 77, 17)
GUICtrlCreateLabel("Adam1213™© - www.adam1213.tk (main programer)", 152, 104, 278, 17)
GUICtrlCreateLabel("David - www.totaldave.tk (Connect 4, links and more)", 152, 120, 289, 17)
GUICtrlCreateLabel("Programed in Autoit script. Beta version: " & @AutoItVersion, 16, 144, 265, 17)
GUICtrlCreateLabel("Some of the GUI was made in Koda FormDesigner 1.4", 16, 160, 259, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$aboutok = GUICtrlCreateButton("&OK", 152, 200, 83, 25)
GUICtrlSetCursor($aboutok, 0)
GUICtrlSetOnEvent($aboutok, "Onaboutclose")
GUISetOnEvent($GUI_EVENT_CLOSE, "Onaboutclose", $AboutGUI)
GUISwitch($AboutGUI)
GUISetState()
EndFunc ;==>onabout
Func Onaboutclose() ;---- Onaboutclose ----
opt("GUICloseOnESC", 0) ;1=ESC closes, 0=ESC won't close
GUISwitch($IRCGUIW)
GUISetState(@SW_ENABLE, $IRCGUIW)
GUIDelete($AboutGUI)
EndFunc ;==>Onaboutclose
;===================== CALABRATION ========================================================================
Func Oncalabratepixelsperline($silent=0) ; --------------------------------------------------------------------------------------
;$pixelsperlinecalebrated=1
$textline=''
for $i=0 to @DesktopWidth/3
$textline&='
'
next
$old_URL=$oIE.LocationURL
$oIE.Document.WriteLn ($textline)
sleep(200)
$pixel_s=$oIE.document.body.scrollHeight
$oIE.Document.WriteLn ('
a')
$pixel_e=$oIE.document.body.scrollHeight
$pixelsperline=$pixel_e-$pixel_s*2
sleep(30)
$oIE.navigate($old_URL)
;IniWrite($settingsplace, "Display \ chat log", "Pixels Per Line", $pixelsperline) ; Number of pixels per line (used for scrolling)
if $silent=0 then
$textline=@CRLF & "Pixels Per Line calibration Complete. Now set to " & $pixelsperline & " pixels per line" & @CRLF
onchatlog ($textline)
endif
EndFunc
Func Oncalcharpl()
$textline="12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
" & @CRLF & _
"00x
" & @CRLF & _
"01x
" & @CRLF & _
"02x
" & @CRLF & _
"03x
" & @CRLF & _
"04x
" & @CRLF & _
"05x
" & @CRLF & _
"06x
" & @CRLF & _
"07x
" & @CRLF & _
"08x
" & @CRLF & _
"09x
" & @CRLF & _
"10x
" & @CRLF & _
"11x
" & @CRLF
onchatlog ($textline)
sleep(200)
$textline="" ; blank textline as there is so much in it
$linelenmax=InputBox ( "Characters per line ", "Enter the coresponding number to the number at the end of the line", $linelenmax)
IniWrite($settingsplace, "Display \ chat log", "Max Characters Per Line", $linelenmax) ; Number of characters per line (used for scrolling, if line is going to be split)
EndFunc
;==========================================================================================================
; ------------------ colour functions -------------------------
func oncolour0()
oncolour(0)
endfunc
func oncolour1()
oncolour(1)
endfunc
func oncolour2()
oncolour(2)
endfunc
func oncolour3()
oncolour(3)
endfunc
func oncolour4()
oncolour(4)
endfunc
func oncolour5()
oncolour(5)
endfunc
func oncolour6()
oncolour(6)
endfunc
func oncolour7()
oncolour(7)
endfunc
func oncolour8()
oncolour(8)
endfunc
func oncolour9()
oncolour(9)
endfunc
func oncolour10()
oncolour(10)
endfunc
func oncolour11()
oncolour(11)
endfunc
func oncolour12()
oncolour(12)
endfunc
func oncolour13()
oncolour(13)
endfunc
func oncolour14()
oncolour(14)
endfunc
func oncolour15()
oncolour(15)
endfunc
func oncolourbold()
oncolourg("")
endfunc
func oncolourunderline()
oncolourg("")
endfunc
func oncoloure1()
oncolourg(":-)")
endfunc
func oncoloure28()
oncolourg(":-(")
endfunc
; -----------------------------------------------
func oncolour($button)
if $rightclick=0 then
$chat12n="" & $button
else
$chat12n="," & $button
endif
oncolourg($chat12n)
endfunc
func oncolourg($chat12n)
$chat12f=GUICtrlRead($chat12) & $chat12n
GUICtrlSetData($chat12, $chat12f )
GUICtrlSetState($chat12, $GUI_FOCUS)
If WinActive($IRCGUIW) Then ControlSend ($title, "", $chat12s, "{end}")
endfunc
;======================= TAB =========================================================
func ontabclick()
$lasttab2=$lasttab
sleep(100)
$tabsel=_GUICtrlTabGetCurSel($tabchan)
$tabinfo=$tabarray[$tabsel]
$chatto=$tabinfo
$lasttab=$chatto
$filedest2=$path & "\Log\" & $tabinfo & ".html"
$oIE.navigate($filedest2)
while $oIE.Busy
sleep(1)
wend
$textline2 = _IEBodyReadHTML($oIE)
if $textline2="0" then $textline2=@CRLF
onchatlog($textline2)
GUICtrlSetData($vchatto, $chatto)
if $chatto<>"Console" then
onsend("/namesc",0)
else
onsend("/names",0)
endif
endfunc
func joinbutton()
HotKeySet("{Enter}")
$room=inputbox("Room", "Enter the room that you want to join", "")
HotKeySet("{Enter}", "EnterSends");
$room=stringstripws($room,3)
if $room<>"#" AND $room<>"" then
onsend("/join " & $room)
endif
endfunc
func partbutton()
$room=GUICtrlRead ($vchatto)
onsend("/part " & $room)
endfunc
func onfilemake($filedest2)
_FileCreate ($filedest2)
FileWrite ($filedest2, _
"" & @CRLF & _
"" & @CRLF & _
"" & @CRLF)
endfunc
;====================== ON UPDATE ==================================
Func onUpdate()
Dim $URL
$URL = "http://www.cjb.cc/members/adam1213/"
_filecreate("newest.txt")
InetGet($URL & "/newest.txt", "newest.txt", 1)
;TrayTip ( "loaded", "done", 1)
FileOpen("newest.txt", 1)
$nversion = FileReadLine("newest.txt", 1)
$nrdate = FileReadLine("newest.txt", 2)
if $nversion="" AND $nrdate="" then
MsgBox(16, "Error", "Could not connect to the server")
else
If $nversion > $version Then
$asku = MsgBox(36, "New version available", "You have " & $version & " - Released " & $releasedate & @CRLF & "Version " & $nversion & " - Released " & $nrdate & " is available" & @CRLF & @CRLF & "Do you want to Update?")
If $asku == "6" Then
;6 - means yes was selected
$desktop = @DesktopDir
$updateplace = FileSaveDialog( "Place for the new version", $desktop, "Executable (*.exe)", 2, "IRC.exe")
InetGet($URL & "update.exe", $updateplace, 1, 0)
$sstarted = $updateplace
$place22 = StringLeft($updateplace, StringInStr($updateplace, "\", 0, -1))
Run("explorer.exe " & $place22)
EndIf
Else
MsgBox(64, "Latest version", "You have " & $version & " - Released " & $releasedate & " which is the latest version.")
EndIf
endif
#cs
onlines()
GUISetState(@SW_DISABLE, $IRCGUIW)
; == GUI generated with Koda ==
Global $AboutGUI = GUICreate("Update", 323, 233, 302, 218, $DS_CONTEXTHELP)
GUICtrlCreateGroup("", 8, 8, 305, 155)
GUICtrlCreatePic($path & "\autoit.jpg", 16, 24, 105, 97)
GUICtrlCreateLabel("Adam1213's IRC Client", 152, 16, 139, 20)
GUICtrlSetFont(-1, 10, 400, 0, "MS Sans Serif")
GUICtrlSetBkColor(-1, 0xFFFF00)
GUICtrlCreateLabel("Version: " & $version, 152, 40, 98, 17)
GUICtrlCreateLabel("Release Date: " & $releasedate, 152, 56, 144, 17)
GUICtrlCreateLabel("Lines: " & $lines, 152, 72, 80, 17)
GUICtrlCreateLabel("Pages: " & $pages, 152, 88, 77, 17)
GUICtrlCreateLabel("Adam1213™©", 152, 104, 100, 17)
GUICtrlCreateLabel("Version: " & $version, 200, 40, 98, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$aboutok = GUICtrlCreateButton("&OK", 112, 170, 75, 25)
GUICtrlSetCursor($aboutok, 0)
GUICtrlSetOnEvent($aboutok, "Onaboutclose")
GUISetOnEvent($GUI_EVENT_CLOSE, "Onaboutclose", $AboutGUI)
GUISwitch($AboutGUI)
GUISetState()
#ce
EndFunc ;==>onUpdate
;================================= CONNNECT 4==========================================================================
Func onconnect4()
if $c4open=0 then
HotKeySet("^p","c4putpiece")
Global $c4place
Global $c4othercolour
Global $c4colour
$oIE.navigate ($path & "\conframes.html")
$oIE.StatusBar = True
Global $c4last = ""
Global $c4close = "no"
$c4open = 1
endif
EndFunc ;==>onconnect4
GUISetState() ;Show GUI
;While $c4close = "no"
Func onc4update()
if $c4open then
global $c4text = _IEFormElementGetValue (_IEFormElementGetObjByName (_IEFormGetObjByName (_IEFrameGetObjByName($oIE,"c4appframe"), "c4form"), "placeinfo"))
If $c4text <> $c4last Then
$c4last = $c4text
TrayTip("status text", $c4text, 10, 16)
onsend("pc4 " & $c4text)
;msgbox(0,"status text", $c4text)
If StringInStr($c4text, "won") <> 0 Then
$c4woncol = StringMid($c4text, StringInStr($c4text, "won") + 3)
onsend("pc4 AUW")
MsgBox(0, "Victory", "AutoIt realises that " & $c4woncol & " has won. Hehe.")
sleep(1000)
$oIE.refresh
ElseIf StringInStr($c4text, "close") <> 0 Then
$c4open = 0
$oIE.navigate($filedest2)
EndIf
EndIf
endif
;WEnd
EndFunc ;==>onc4update
func onc4recv()
c4extractrecv()
c4sendplace($c4place,$c4colour)
endfunc
Func c4sendplace($numplace, $imgcolour)
$oIE.navigate ("javascript:void(parent.c4appframe.document.conseg[" & $numplace & "].src=" & $imgcolour & "img.src);")
EndFunc ;==>c4sendplace
Func c4putpiece()
If $c4text <> "waiting" Then
c4extractvars()
$c4otherplace = InputBox("place", "Where should other person go? (number)", "")
c4sendplace($c4otherplace, $c4othercolour)
EndIf
EndFunc ;==>c4putpiece
Func c4extractvars()
If StringInStr($c4text,"waiting") == 0 Then
; $c4tpl, $c4epl, and $c4diffamt are used in extracting the place var...
$c4tpl = StringInStr($c4text, "t")
$c4epl = StringInStr($c4text, "e")
$c4diffamt = $c4tpl - $c4epl - 1
; The place variable!
$c4place = StringMid($c4text, 6, $c4diffamt)
; The colour variable!
$c4colour = StringMid($c4text, StringInStr($c4text, "turn") + 4, 3)
; And finally, othercolour.
If $c4colour == "yel" Then
$c4othercolour = "red"
ElseIf $c4colour == "red" Then
$c4othercolour = "yel"
EndIf
EndIf
EndFunc ;==>c4extractvars
Func c4extractrecv()
If StringInStr($c4recv,"waiting") == 0 Then
If StringInStr($c4recv,"AUW") <> 0 Then
MsgBox(0,"",$rrname & " has won!")
$oIE.navigate("javascript:parent.c4appframe.location.reload();")
Else
; $c4tpl, $c4epl, and $c4diffamt are used in extracting the place var...
$c4tpl = StringInStr($c4recv, "t")
$c4epl = StringInStr($c4recv, "e")
$c4diffamt = $c4tpl - $c4epl - 1
; The place variable!
$c4place = StringMid($c4recv, 6, $c4diffamt)
; The colour variable!
$c4colour = StringMid($c4recv, StringInStr($c4recv, "turn") + 4, 3)
; And finally, othercolour.
If $c4colour == "yel" Then
$c4othercolour = "red"
ElseIf $c4colour == "red" Then
$c4othercolour = "yel"
EndIf
EndIf
EndIf
EndFunc ;==>c4extractrecv
Func c4OnExit()
HotKeySet("^p")
$c4close = "yes"
$c4open = 0
EndFunc ;==>c4OnExit
Func onlines() ; count lines
If @Compiled = 0 Then Global $lines = @ScriptLineNumber + 2
Global $pages = Round($lines / 50+0.49999999)
EndFunc