Jump to content

A little help


James
 Share

Recommended Posts

Hi,

GUICtrlCreateInput, GuiCtrlRead and IniWrite should do the trick.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

And yet again I'm stuck.

I have done what you said, but now I get the box appearing in the GUI window.

Could someone help me to get the text read and saved in a .ini? I can make it read what is in it.

Here is my code so far, try it, and you will see whats wrong with it.

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\James\My Documents\Codes\Koda_1.6.0.2\Forms\msn msg.kxf
$window = GUICreate("MSN Auto-Reply", 339, 417, -1, -1)
$start = GUICtrlCreateButton("Start MSN Message", 8, 152, 121, 57, 0)
$stop = GUICtrlCreateButton("Stop MSN Message", 8, 224, 121, 57, 0)
$setText = GUICtrlCreateButton("Set text to send", 8, 80, 121, 57, 0)
$set1 = GUICtrlCreateEdit("", 144, 96, 185, 25, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, "Enter the text that you wish to send.")
$start1 = GUICtrlCreateInput("Start the Message Replier", 144, 168, 185, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
$stop1 = GUICtrlCreateInput("Stop the Message Replier", 144, 240, 185, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
$help = GUICtrlCreateButton("Help me!!!!", 8, 296, 321, 81, 0)
$welcome = GUICtrlCreateEdit("", 9, 8, 322, 57, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, StringFormat("Welcome to the MSN Auto Replier by Secure_ICT. To start press \r\nSet Text and enter the text you wish to be entered when someone \r\ntalks to you.\r\n"))
$disclaimer = GUICtrlCreateEdit("", 8, 384, 321, 25, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, StringFormat("This is a free script. Edit it to suit your needs.\r\n"))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $help
            SplashTextOn ( "Help me", "" & @CRLF & """Welcome to the MSN Auto Message Help."& @CRLF &"It's simple to make this run. All you need to do, is click the Set Text "& @CRLF &"button and "& @CRLF &"enter the text that you wish to be displayed when someone speaks to "& @CRLF &"you."& @CRLF &"You only have to set the text once as it saves the text as a .ini"& @CRLF &" "& @CRLF &"Then just press start and it will enter the message to any open MSN "& @CRLF &"conversation "& @CRLF &"window."& @CRLF &"Need more help? Just ask me on the topic."& @CRLF &""& @CRLF &"Secure_ICT")
            Sleep(10000)
            SplashOff()
        Case $setText
            GUICtrlCreateInput("Set the text", "Type here the text that you would like to have sent. This text will be sent each time the program is run, and there is a MSN conversation window.", "", "")
    EndSwitch
WEnd
Link to comment
Share on other sites

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\James\My Documents\Codes\Koda_1.6.0.2\Forms\msn msg.kxf
$window = GUICreate("MSN Auto-Reply", 339, 417, -1, -1)
$start = GUICtrlCreateButton("Start MSN Message", 8, 152, 121, 57, 0)
$stop = GUICtrlCreateButton("Stop MSN Message", 8, 224, 121, 57, 0)
$setText = GUICtrlCreateButton("Set text to send", 8, 80, 121, 57, 0)
$set1 = GUICtrlCreateEdit("", 144, 96, 185, 25, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, "Enter the text that you wish to send.")
$start1 = GUICtrlCreateInput("Start the Message Replier", 144, 168, 185, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
$stop1 = GUICtrlCreateInput("Stop the Message Replier", 144, 240, 185, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
$help = GUICtrlCreateButton("Help me!!!!", 8, 296, 321, 81, 0)
$welcome = GUICtrlCreateEdit("", 9, 8, 322, 57, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, StringFormat("Welcome to the MSN Auto Replier by Secure_ICT. To start press \r\nSet Text and enter the text you wish to be entered when someone \r\ntalks to you.\r\n"))
$disclaimer = GUICtrlCreateEdit("", 8, 384, 321, 25, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, StringFormat("This is a free script. Edit it to suit your needs.\r\n"))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $help
            SplashTextOn ( "Help me", "" & @CRLF & """Welcome to the MSN Auto Message Help."& @CRLF &"It's simple to make this run. All you need to do, is click the Set Text "& @CRLF &"button and "& @CRLF &"enter the text that you wish to be displayed when someone speaks to "& @CRLF &"you."& @CRLF &"You only have to set the text once as it saves the text as a .ini"& @CRLF &" "& @CRLF &"Then just press start and it will enter the message to any open MSN "& @CRLF &"conversation "& @CRLF &"window."& @CRLF &"Need more help? Just ask me on the topic."& @CRLF &""& @CRLF &"Secure_ICT")
            Sleep(10000)
            SplashOff()
        Case $setText
            $text = GUICtrlRead($setText)
            IniWrite("Text.ini", "MSN Text", "text1", $text)            
    EndSwitch
WEnd

I'm not sure why you were creating an input when you clicked on the set text button....I think you want to take the text in the input already there and save it to an .ini file?

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
Share on other sites

I changed what happened when you clicked Set Text......is the result what you desired?

Case $setText
            $text = GUICtrlRead($setText)
            IniWrite("Text.ini", "MSN Text", "text1", $text)
IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
Share on other sites

I obviously don't understand what you are trying to do. What is wrong with using the input box you have already created there?

Edit: Sorry, I meant to read $set1, not $setText.

Case $setText
            $text = GUICtrlRead($set1)
            IniWrite("Text.ini", "MSN Text", "text1", $text)

Does that help? It's not clicking the button, it's reading the edit beside it.

Edited by mikehunt114
IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
Share on other sites

Hi,

or just

SplashOff()

Case $setText

IniWrite("Text.ini", "MSN Text", "text1", GUICtrlRead($set1))

EndSwitch

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

I know I removed the input box...what I'm trying to tell you is that it is unnecessary. The person types in the edit box, you read the edit box. Does that not accomplish your goal? My apologies if I called an edit an input.

Edited by mikehunt114
IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
Share on other sites

*shrugs* Ok, but when I read it, I think I need to type in that box. If that's not what you want, you should put that text in a label and not an edit. If I see an edit, I assume you want me to edit it. If you want an input to come up, use a MsgBox? Creating an input in addition to that edit is redundant.

IE Dev ToolbarMSDN: InternetExplorer ObjectMSDN: HTML/DHTML Reference Guide[quote]It is surprising what a man can do when he has to, and how little most men will do when they don't have to. - Walter Linn[/quote]--------------------[font="Franklin Gothic Medium"]Post a reproducer with less than 100 lines of code.[/font]
Link to comment
Share on other sites

Hi,

I agree. :P

I thought totally the same.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

Hi,

SplashOff()

Case $setText

IniWrite("Text.ini", "MSN Text", "text1", InputBox("save to ini", "Type : ", "", "", 200, 50) )

EndSwitch

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to comment
Share on other sites

For Mike:

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=c:\documents and settings\james\my documents\codes\koda_1.6.0.2\forms\msn msg.kxf
$window = GUICreate("MSN Auto-Reply", 339, 417, -1, -1)
$start = GUICtrlCreateButton("Start MSN Message", 8, 152, 121, 57, 0)
$Button2 = GUICtrlCreateButton("Stop MSN Message", 8, 224, 121, 57, 0)
$setText = GUICtrlCreateButton("Set text to send", 8, 80, 121, 57, 0)
$start1 = GUICtrlCreateLabel("Start the Message Replier", 144, 168, 185, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
$stop1 = GUICtrlCreateLabel("Stop the Message Replier", 144, 240, 185, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
$help = GUICtrlCreateButton("Help me!!!!", 8, 296, 321, 81, 0)
$welcome = GUICtrlCreateEdit("", 9, 8, 322, 57, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, StringFormat("Welcome to the MSN Auto Replier by Secure_ICT. To start press \r\nSet Text and enter the text you wish to be entered when someone \r\ntalks to you.\r\n"))
$disclaimer = GUICtrlCreateEdit("", 8, 384, 321, 25, BitOR($ES_CENTER,$ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_WANTRETURN))
GUICtrlSetData(-1, StringFormat("This is a free script. Edit it to suit your needs.\r\n"))
$setlabel = GUICtrlCreateLabel("Set the text you wish to be sent", 144, 96, 177, 21, BitOR($ES_CENTER,$ES_AUTOHSCROLL))
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $help
            SplashTextOn ( "Help me", "" & @CRLF & """Welcome to the MSN Auto Message Help."& @CRLF &"It's simple to make this run. All you need to do, is click the Set Text "& @CRLF &"button and "& @CRLF &"enter the text that you wish to be displayed when someone speaks to "& @CRLF &"you."& @CRLF &"You only have to set the text once as it saves the text as a .ini"& @CRLF &" "& @CRLF &"Then just press start and it will enter the message to any open MSN "& @CRLF &"conversation "& @CRLF &"window."& @CRLF &"Need more help? Just ask me on the topic."& @CRLF &""& @CRLF &"Secure_ICT")
            Sleep(10000)
            SplashOff()
        Case $setText
            $text = GUICtrlRead($set1)
            IniWrite("Text.ini", "MSN Text", "text1", $text)       
    EndSwitch
WEnd
Link to comment
Share on other sites

Hmm... I'm having a problem sending the msg. It works on my old version.

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $help
            SplashTextOn ( "Help me", "" & @CRLF & """Welcome to the MSN Auto Message Help."& @CRLF &"It's simple to make this run. All you need to do, is click the Set Text "& @CRLF &"button and "& @CRLF &"enter the text that you wish to be displayed when someone speaks to "& @CRLF &"you."& @CRLF &"You only have to set the text once as it saves the text as a .ini"& @CRLF &" "& @CRLF &"Then just press start and it will enter the message to any open MSN "& @CRLF &"conversation "& @CRLF &"window."& @CRLF &"Need more help? Just ask me on the topic."& @CRLF &""& @CRLF &"Secure_ICT")
            Sleep(10000)
            SplashOff()
        Case $setText
            IniWrite("Text.ini", "MSN Text", "TXT", InputBox("save to ini", "Type : ", "", "", 200, 50) )   
        Case $start
            IniRead("Text.ini", "TXT")
                If WinExists("- Conversation") Then
                WinActivate("- Conversation")
                Send($msn & "{enter}") 
                WinClose("- Conversation")
                EndIf
    EndSwitch
WEnd
Edited by Secure_ICT
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...