Sign in to follow this  
Followers 0
Swift

Nice Bug In My Program...

8 posts in this topic

#1 ·  Posted (edited)

Me and JustinReno made this program (he helped :)) and..i almost got all of the functions and stuff down so i can connect it...but....ok try this with it...open the program...and type stuff in the middle box...see if it shows up in the edit...if it does...good...but now go to Bot>Bot Settings...open it...and close it...now try to type...it doesnt work...

---===<Program will take approx: 5 seconds to come up...because of the Splash...that you dont have :blink:>===---

thanks...for your help :P

EDIT: changed the .au3 bot file

Edited by Swift

Share this post


Link to post
Share on other sites



Me and JustinReno made this program (he helped :)) and..i almost got all of the functions and stuff down so i can connect it...but....ok try this with it...open the program...and type stuff in the middle box...see if it shows up in the edit...if it does...good...but now go to Bot>Bot Settings...open it...and close it...now try to type...it doesnt work...

---===<Program will take approx: 5 seconds to come up...because of the Splash...that you dont have :blink:>===---

thanks...for your help :P

2 things to do.

1) In your Bot function don't create another gui with the same name as the main one. Call it $Gui2 say.

2) At the end of your Bot function destroy $gui2; you don't want to keep crewating extra ones every time you call Bot(). Add GuiDelete($Gui2) at the end of the function.

I think that will fix it.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

martin...have i ever told you...how smart you are at autoit??...well you are...cuz that fixed it awesomely...thanks :P:):blink:

Edited by Swift

Share this post


Link to post
Share on other sites

martin...have i ever told you...how smart you are at autoit??...well you are...cuz that fixed it awesomely...thanks :P:):blink:

Glad it worked.

I'm not so smart; I've been struggling for 3 years and you've only just started. In 3 years time (or less) you'll be telling me how stupid I am.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

O.o dont do that to yourself...but another bug :)....ill change the attachedment on the first one...and show you the new one...this one...will not create the line in the ini file for SetServer...ive checked over it many times..but when you go to Bot>Bot Settings...make up some stuff and it auto-saves the .ini to your desktop...but look @ it..there is no SetServer...its making me mad...you gotta add it yourself >.<...heres the new one::

#NoTrayIcon
#include <GuiConstants.au3>
$splash = @DesktopDir & "\drag.jpg"
SplashImageOn("ßãÐßø v1.2 ßÿ §wift", $splash, 600, 500)
Sleep(5000)
SplashOff()

HotKeySet("{ENTER}", "_AddToEdit")


$Settings = 0;settings window thing

$Gui = GUICreate("BaDBoT V1.2R2 (By Swift)", 390, 360)
GUISetBkColor(0x000000)
$input1 = GUICtrlCreateInput("", 5, 275, 40, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
$input2 = GUICtrlCreateInput("", 245, 275, 60, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
$inputbox = GUICtrlCreateInput("", 45, 275, 200, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
$Edit = GUICtrlCreateEdit("", 5, 5, 300, 270, $GUI_SS_DEFAULT_EDIT + $ES_READONLY)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetColor(-1, 0xFFFFFF)
$menue = GUICtrlCreateMenu("Bot")
$Settings = GUICtrlCreateMenu("Settings")
$Button_1 = GUICtrlCreateMenuItem("Connect", -1)
$Button_2 = GUICtrlCreateMenuItem("Disconnect", -1)
GUICtrlCreateMenuItem("Userlist Manager", $menue)
GUICtrlCreateMenuItem("Custom Command Editor", $menue)
GUICtrlCreateMenuItem("User Monitor", $menue)
GUICtrlCreateMenuItem("Get News And Check For Updates", $menue)
GUICtrlCreateMenuItem("", $menue)
GUICtrlCreateMenuItem("Ignore Clan Invitations", $menue)
GUICtrlCreateMenuItem("", $menue)
GUICtrlCreateMenuItem("Quick Channels", $menue)
GUICtrlCreateMenuItem("Exit", $menue)
$botsettingsitem = GUICtrlCreateMenuItem("Bot Settings", $Settings)
GUICtrlCreateMenuItem("Use UDF-8 Encoding/Decoding", $Settings)
GUICtrlCreateMenuItem("", $Settings)
GUICtrlCreateMenuItem("Edit Profile", $Settings)
GUICtrlCreateMenuItem("Edit Chat Filters", $Settings)
GUICtrlCreateMenuItem("Edit Catch Phrases", $Settings)
GUICtrlCreateMenuItem("", $Settings)
GUICtrlCreateMenuItem("View Caught Phrases", $Settings)
GUICtrlCreateMenuItem("Edit Files...", $Settings)
GUICtrlCreateMenuItem("", $Settings)
$reload = GUICtrlCreateMenuItem("Reload Config", $Settings)
GUICtrlCreateMenuItem("Reload Script", $Settings)
$window = GUICtrlCreateMenu("Window")
GUICtrlCreateMenuItem("Toggle Join/Leave Messages", $window)
GUICtrlCreateMenuItem("Toggle Chat Window Lock", $window)
GUICtrlCreateMenuItem("Toggle Chat Filters", $window)
GUICtrlCreateMenuItem("", $window)
GUICtrlCreateMenuItem("Use Individual Whisper Windows", $window)
GUICtrlCreateMenuItem("", $window)
GUICtrlCreateMenuItem("Show Outgoing Whispers In Whisper Box", $window)
GUICtrlCreateMenuItem("Hide Whispers In Main Window", $window)
GUICtrlCreateMenuItem("", $window)
GUICtrlCreateMenuItem("Logging Settings", $window)
GUICtrlCreateMenuItem("", $window)
GUICtrlCreateMenuItem("Clear Chat Window", $window)
GUICtrlCreateMenuItem("Clear Whisper Window", $window)
GUICtrlCreateMenuItem("", $window)
GUICtrlCreateMenuItem("Flash Window On Events", $window)
GUICtrlCreateMenuItem("Disable Void View", $window)
$help = GUICtrlCreateMenu("Help")
$aboutbox = GUICtrlCreateMenuItem("About...", $help)
$readme = GUICtrlCreateMenuItem("Readme and Command List", $help)
$homepage = GUICtrlCreateMenuItem("Homepage", $help)

GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button_1
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "[BNLS]Connecting..." & @CRLF)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "[BNLS]Connected!" & @CRLF)
            Sleep(1500)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "[BNET]Connecting..." & @CRLF)
            Sleep(1000)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "[BNET]Connected!" & @CRLF)
            Sleep(750)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "Sending Login Information..." & @CRLF)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "Login Successful." & @CRLF)
            Sleep(750)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "Joined Channel: " & IniRead(@ScriptDir & "\Config.ini", "Config", "HomeChannel", "") & "" & @CRLF)
            
            #CS THIS WAS WHAT WAS BEFORE I EDITED IT!
                Case $Button_1, $Button_2, $inputbox
                $NewData = "[BNLS]Connecting..."& @CRLF & "[BNLS]Connected!" & @CRLF & "[BNET]Connecting..." & @CRLF & "[BNET]Connected!" & @CRLF & "[BNET]Sending Login Information" & @CRLF & "Login Successful" & @CRLF & "Joined Home Channel"
                If $Msg = $Button_2 Then $NewData = "Hello!"
                
                $Read_Edit = GUICtrlRead($Edit)
                If $Read_Edit <> "" Then $NewData = @CRLF & $NewData
                
                $Read_edit = GUICtrlRead($Edit)
                If $Read_Edit <> "" Then $NewData = @CRLF & $inputbox
                
                GUICtrlSetData($Edit, $Read_Edit & $NewData)
                GUICtrlSendMsg($Edit, 0xB7, 0, 0)
                Case $connect, $disconnect
                $NewData = "Connecting.."
                If $Msg = $disconnect Then $NewData = "Disconnected!"
                $ReadD_Edit = GUICtrlRead($Edit)
                If $Read_Edit <> "" Then $NewData = @CRLF & $NewData
            #CE
        Case $Button_2
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "[BNET] Disconnected!" & @CRLF)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "[BNET] All Connections Closed!" & @CRLF)
        Case $reload
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "Configuration Settings Saved" & @CRLF)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "Configuration Settings Loaded" & @CRLF)
            
        Case $botsettingsitem; <-- Add an exception for the menu item
            $Settings = 1;enable settings window loop
            _Bot()
        Case $aboutbox
            MsgBox(0, "About", "BaDBoT v1.2 By: Swift")
        Case $homepage
            Run(@ComSpec & " /c Start https://www.autoitscript.com/forum/index.php?showuser=30516", "", @SW_HIDE)
            Sleep(3500)
            Send("y")
    EndSwitch
WEnd


Func _Bot()

;;---Your Program below:
    $k = IniRead(@ScriptDir & "\Config.ini", "Config", "Account", "")
    $m = IniRead(@ScriptDir & "\config.ini", "config", "Password", "")
    $l = IniRead(@ScriptDir & "\config.ini", "config", "HomeChannel", "")
    $a = IniRead(@ScriptDir & "\config.ini", "config", "SetServer", "")
    $keyz = IniRead(@ScriptDir & "\config.ini", "config", "CD-Key", "")


    $Gui2 = GUICreate("Bot Config", 160, 250, -1, -1)
    GUISetBkColor(0x00FF00)
    GUICtrlCreateLabel("Connect To", 10, 205, 130, 15)
    GUICtrlCreateRadio("D2", 10, 220, -1, -1)
    GuiCtrlSetState(-1, $GUI_CHECKED)
    GUICtrlCreateRadio("War3", 50, 220, -1, -1)
    $Label_1 = GUICtrlCreateLabel("Username", 10, 5, 130, 15)
    $Input_1 = GUICtrlCreateInput($k, 10, 20, 100, 20)
    $key = GUICtrlCreateInput($keyz, 10, 180, 100, 20)
    GUICtrlCreateLabel("Password", 10, 45, 130, 15)
    GUICtrlCreateLabel("Home Channel", 10, 85, 130, 15)
    GUICtrlCreateLabel("Server", 10, 125, 130, 15)
    GUICtrlCreateLabel("CD-Key", 10, 165, 130, 15)
    $chan = GUICtrlCreateInput($l, 10, 100, 100, 20)
    $pass = GUICtrlCreateInput($m, 10, 60, 100, 20)
    $server = GUICtrlCreateInput($a, 10, 140, 100, 20)
    GUISetState(@SW_SHOW)
    While $Settings = 1;settings on
        $nMsg = GUIGetMsg()
        Select
            Case $nMsg = $GUI_EVENT_CLOSE
                GUIDelete("Bot Configuration Settings");delete settings window
                $Settings = 0;turn off settings
                GuiDelete($Gui2)
            Case $nMsg = $pass
                $EDIT_READ = GUICtrlRead($Input_1)
                IniWrite(@ScriptDir & "\Config.ini", "Config", "Account", $EDIT_READ)
                $password = GUICtrlRead($pass)
                IniWrite(@ScriptDir & "\config.ini", "Config", "Password", $password)
            Case $nMsg = $chan
                $homechan = GUICtrlRead($chan)
                IniWrite(@ScriptDir & "\config.ini", "Config", "HomeChannel", $homechan)
            Case $nMsg = $server
                $server1 = GUICtrlRead($server)
                IniWrite(@ScriptDir & "\config.ini", "Config", "SetServer", $server1)
            Case $nMsg = $key
                $keys = GUICtrlRead($key)
                IniWrite(@ScriptDir & "\config.ini", "Config", "CD-Key", $keys)
            EndSelect
    WEnd
EndFunc  ;==>_Bot

Func _AddToEdit()
    Local $Opt = Opt("WinTitleMatchMode", 4)
    If WinGetHandle("Active") = $Gui Then
        If @HotKeyPressed = "{ENTER}" Then
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "<" & IniRead(@ScriptDir & "\Config.ini", "Config", "Account", "") & "> " & GUICtrlRead($inputbox) & @CRLF)
            GUICtrlSetData($inputbox, "")
        EndIf
    Else
        HotKeySet(@HotKeyPressed)
        Send(@HotKeyPressed)
        HotKeySet(@HotKeyPressed, "_AddToEdit")
    EndIf
    Opt("WinTitleMatchMode", $Opt)
EndFunc  ;==>_AddToEdit

Thanks---Help from JustinReno Creating It.

Share this post


Link to post
Share on other sites

O.o dont do that to yourself...but another bug :)....ill change the attachedment on the first one...and show you the new one...this one...will not create the line in the ini file for SetServer...ive checked over it many times..but when you go to Bot>Bot Settings...make up some stuff and it auto-saves the .ini to your desktop...but look @ it..there is no SetServer...its making me mad...you gotta add it yourself >.<...heres the new one::

#NoTrayIcon
#include <GuiConstants.au3>
$splash = @DesktopDir & "\drag.jpg"
SplashImageOn("ßãÐßø v1.2 ßÿ §wift", $splash, 600, 500)
Sleep(5000)
SplashOff()

HotKeySet("{ENTER}", "_AddToEdit")


$Settings = 0;settings window thing

$Gui = GUICreate("BaDBoT V1.2R2 (By Swift)", 390, 360)
GUISetBkColor(0x000000)
$input1 = GUICtrlCreateInput("", 5, 275, 40, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
$input2 = GUICtrlCreateInput("", 245, 275, 60, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
$inputbox = GUICtrlCreateInput("", 45, 275, 200, 20)
GUICtrlSetColor(-1, 0xFFFFFF)
GUICtrlSetBkColor(-1, 0x000000)
$Edit = GUICtrlCreateEdit("", 5, 5, 300, 270, $GUI_SS_DEFAULT_EDIT + $ES_READONLY)
GUICtrlSetBkColor(-1, 0x000000)
GUICtrlSetColor(-1, 0xFFFFFF)
$menue = GUICtrlCreateMenu("Bot")
$Settings = GUICtrlCreateMenu("Settings")
$Button_1 = GUICtrlCreateMenuItem("Connect", -1)
$Button_2 = GUICtrlCreateMenuItem("Disconnect", -1)
GUICtrlCreateMenuItem("Userlist Manager", $menue)
GUICtrlCreateMenuItem("Custom Command Editor", $menue)
GUICtrlCreateMenuItem("User Monitor", $menue)
GUICtrlCreateMenuItem("Get News And Check For Updates", $menue)
GUICtrlCreateMenuItem("", $menue)
GUICtrlCreateMenuItem("Ignore Clan Invitations", $menue)
GUICtrlCreateMenuItem("", $menue)
GUICtrlCreateMenuItem("Quick Channels", $menue)
GUICtrlCreateMenuItem("Exit", $menue)
$botsettingsitem = GUICtrlCreateMenuItem("Bot Settings", $Settings)
GUICtrlCreateMenuItem("Use UDF-8 Encoding/Decoding", $Settings)
GUICtrlCreateMenuItem("", $Settings)
GUICtrlCreateMenuItem("Edit Profile", $Settings)
GUICtrlCreateMenuItem("Edit Chat Filters", $Settings)
GUICtrlCreateMenuItem("Edit Catch Phrases", $Settings)
GUICtrlCreateMenuItem("", $Settings)
GUICtrlCreateMenuItem("View Caught Phrases", $Settings)
GUICtrlCreateMenuItem("Edit Files...", $Settings)
GUICtrlCreateMenuItem("", $Settings)
$reload = GUICtrlCreateMenuItem("Reload Config", $Settings)
GUICtrlCreateMenuItem("Reload Script", $Settings)
$window = GUICtrlCreateMenu("Window")
GUICtrlCreateMenuItem("Toggle Join/Leave Messages", $window)
GUICtrlCreateMenuItem("Toggle Chat Window Lock", $window)
GUICtrlCreateMenuItem("Toggle Chat Filters", $window)
GUICtrlCreateMenuItem("", $window)
GUICtrlCreateMenuItem("Use Individual Whisper Windows", $window)
GUICtrlCreateMenuItem("", $window)
GUICtrlCreateMenuItem("Show Outgoing Whispers In Whisper Box", $window)
GUICtrlCreateMenuItem("Hide Whispers In Main Window", $window)
GUICtrlCreateMenuItem("", $window)
GUICtrlCreateMenuItem("Logging Settings", $window)
GUICtrlCreateMenuItem("", $window)
GUICtrlCreateMenuItem("Clear Chat Window", $window)
GUICtrlCreateMenuItem("Clear Whisper Window", $window)
GUICtrlCreateMenuItem("", $window)
GUICtrlCreateMenuItem("Flash Window On Events", $window)
GUICtrlCreateMenuItem("Disable Void View", $window)
$help = GUICtrlCreateMenu("Help")
$aboutbox = GUICtrlCreateMenuItem("About...", $help)
$readme = GUICtrlCreateMenuItem("Readme and Command List", $help)
$homepage = GUICtrlCreateMenuItem("Homepage", $help)

GUISetState()

While 1
    $Msg = GUIGetMsg()
    Switch $Msg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button_1
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "[BNLS]Connecting..." & @CRLF)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "[BNLS]Connected!" & @CRLF)
            Sleep(1500)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "[BNET]Connecting..." & @CRLF)
            Sleep(1000)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "[BNET]Connected!" & @CRLF)
            Sleep(750)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "Sending Login Information..." & @CRLF)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "Login Successful." & @CRLF)
            Sleep(750)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "Joined Channel: " & IniRead(@ScriptDir & "\Config.ini", "Config", "HomeChannel", "") & "" & @CRLF)
            
            #CS THIS WAS WHAT WAS BEFORE I EDITED IT!
                Case $Button_1, $Button_2, $inputbox
                $NewData = "[BNLS]Connecting..."& @CRLF & "[BNLS]Connected!" & @CRLF & "[BNET]Connecting..." & @CRLF & "[BNET]Connected!" & @CRLF & "[BNET]Sending Login Information" & @CRLF & "Login Successful" & @CRLF & "Joined Home Channel"
                If $Msg = $Button_2 Then $NewData = "Hello!"
                
                $Read_Edit = GUICtrlRead($Edit)
                If $Read_Edit <> "" Then $NewData = @CRLF & $NewData
                
                $Read_edit = GUICtrlRead($Edit)
                If $Read_Edit <> "" Then $NewData = @CRLF & $inputbox
                
                GUICtrlSetData($Edit, $Read_Edit & $NewData)
                GUICtrlSendMsg($Edit, 0xB7, 0, 0)
                Case $connect, $disconnect
                $NewData = "Connecting.."
                If $Msg = $disconnect Then $NewData = "Disconnected!"
                $ReadD_Edit = GUICtrlRead($Edit)
                If $Read_Edit <> "" Then $NewData = @CRLF & $NewData
            #CE
        Case $Button_2
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "[BNET] Disconnected!" & @CRLF)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "[BNET] All Connections Closed!" & @CRLF)
        Case $reload
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "Configuration Settings Saved" & @CRLF)
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "Configuration Settings Loaded" & @CRLF)
            
        Case $botsettingsitem; <-- Add an exception for the menu item
            $Settings = 1;enable settings window loop
            _Bot()
        Case $aboutbox
            MsgBox(0, "About", "BaDBoT v1.2 By: Swift")
        Case $homepage
            Run(@ComSpec & " /c Start https://www.autoitscript.com/forum/index.php?showuser=30516", "", @SW_HIDE)
            Sleep(3500)
            Send("y")
    EndSwitch
WEnd


Func _Bot()

;;---Your Program below:
    $k = IniRead(@ScriptDir & "\Config.ini", "Config", "Account", "")
    $m = IniRead(@ScriptDir & "\config.ini", "config", "Password", "")
    $l = IniRead(@ScriptDir & "\config.ini", "config", "HomeChannel", "")
    $a = IniRead(@ScriptDir & "\config.ini", "config", "SetServer", "")
    $keyz = IniRead(@ScriptDir & "\config.ini", "config", "CD-Key", "")


    $Gui2 = GUICreate("Bot Config", 160, 250, -1, -1)
    GUISetBkColor(0x00FF00)
    GUICtrlCreateLabel("Connect To", 10, 205, 130, 15)
    GUICtrlCreateRadio("D2", 10, 220, -1, -1)
    GuiCtrlSetState(-1, $GUI_CHECKED)
    GUICtrlCreateRadio("War3", 50, 220, -1, -1)
    $Label_1 = GUICtrlCreateLabel("Username", 10, 5, 130, 15)
    $Input_1 = GUICtrlCreateInput($k, 10, 20, 100, 20)
    $key = GUICtrlCreateInput($keyz, 10, 180, 100, 20)
    GUICtrlCreateLabel("Password", 10, 45, 130, 15)
    GUICtrlCreateLabel("Home Channel", 10, 85, 130, 15)
    GUICtrlCreateLabel("Server", 10, 125, 130, 15)
    GUICtrlCreateLabel("CD-Key", 10, 165, 130, 15)
    $chan = GUICtrlCreateInput($l, 10, 100, 100, 20)
    $pass = GUICtrlCreateInput($m, 10, 60, 100, 20)
    $server = GUICtrlCreateInput($a, 10, 140, 100, 20)
    GUISetState(@SW_SHOW)
    While $Settings = 1;settings on
        $nMsg = GUIGetMsg()
        Select
            Case $nMsg = $GUI_EVENT_CLOSE
                GUIDelete("Bot Configuration Settings");delete settings window
                $Settings = 0;turn off settings
                GuiDelete($Gui2)
            Case $nMsg = $pass
                $EDIT_READ = GUICtrlRead($Input_1)
                IniWrite(@ScriptDir & "\Config.ini", "Config", "Account", $EDIT_READ)
                $password = GUICtrlRead($pass)
                IniWrite(@ScriptDir & "\config.ini", "Config", "Password", $password)
            Case $nMsg = $chan
                $homechan = GUICtrlRead($chan)
                IniWrite(@ScriptDir & "\config.ini", "Config", "HomeChannel", $homechan)
            Case $nMsg = $server
                $server1 = GUICtrlRead($server)
                IniWrite(@ScriptDir & "\config.ini", "Config", "SetServer", $server1)
            Case $nMsg = $key
                $keys = GUICtrlRead($key)
                IniWrite(@ScriptDir & "\config.ini", "Config", "CD-Key", $keys)
            EndSelect
    WEnd
EndFunc ;==>_Bot

Func _AddToEdit()
    Local $Opt = Opt("WinTitleMatchMode", 4)
    If WinGetHandle("Active") = $Gui Then
        If @HotKeyPressed = "{ENTER}" Then
            GUICtrlSetData($Edit, GUICtrlRead($Edit) & "<" & IniRead(@ScriptDir & "\Config.ini", "Config", "Account", "") & "> " & GUICtrlRead($inputbox) & @CRLF)
            GUICtrlSetData($inputbox, "")
        EndIf
    Else
        HotKeySet(@HotKeyPressed)
        Send(@HotKeyPressed)
        HotKeySet(@HotKeyPressed, "_AddToEdit")
    EndIf
    Opt("WinTitleMatchMode", $Opt)
EndFunc ;==>_AddToEdit

Thanks---Help from JustinReno Creating It.

The line

GUIDelete("Bot Configuration Settings");delete settings window

doesn't do anything because there is no such window.

Using the id of an edit for an event or message the way you have is not something I have ever done and it isn't very predictable. If you add a consolewrite line after every case you will see what I mean.

I suggest you don't have those case statements. Instead either have a button "Apply" say, or add some code for the case $GUI_EVENT_CLOSE, and ask if the changes should be saved. If yes then read each edit in turn and save.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

marvin..now my program doesnt work at all :)

Share this post


Link to post
Share on other sites

Because of the way you coded it, just press enter after every time you enter something, it works fine for me.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0