Jump to content

Recommended Posts

Posted (edited)

#include <GuiConstants.au3>
Global $weeFile = FileOpen ( "wee.txt", 0 )
If $weeFile = -1 Then 
    MsgBox ( 0, "Error", "Unable to update." ) 
    Exit 
  EndIf 
Global $q = HotKeySet ( "{END}", "q" ) 

$okbutton = GuiCtrlCreateButton ("Update",50,250,70,20)

Func q () 

  FileClose ( $weeFile ) 
  Exit 

  Return 
EndFunc 



;funtions
GuiSetState()

While 1

$wee2 = FileReadLine ( $weeFile ) 


    $msg = GUIGetMsg()
    

    Select
        
        Case $msg = $okbutton
                                                send ('{tab 4}', $wee2)


    endselect
WEnd

GUIDelete()

Exit

So basically it's not working like it should, anyone tell me what i'm doing wrong?

I want it to send the text in the text file well, it's not....

Edited by backstabbed

tolle indicium

Posted

First of all, How did you make that code? Its all over the place.

Secondly, What your doing, is like, Wack?

Thirdly, Are you trying to:

Make a file.ini

Write {tab 4} to the file?

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Posted

lol, i kinda took it apart from the real file i was making and made an example, it sends tab 4 times before it sends the text, it reads the File.txt, wich i am editing now..

tolle indicium

Posted

Perhaps you should post the real file as there is no way this one can work. You can't create a button if you have not first created a GUI to put it on. You do not need to declare a global variable for the HotKeySet. etc etc.


Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Posted

Well,

You have GUIDelete() Yet you have no gui, That would also be why the button doesnt appear. And, What is sending tab 4 times supposed to accomplish? Lol.

And your send line

Send("{tab 4}", $wee)

I have no idea what its supposed to do:

Parameters

keys The sequence of keys to send. 
flag [optional] Changes how "keys" is processed:
  flag = 0 (default), Text contains special characters like + and ! to indicate SHIFT and ALT key-presses.
  flag = 1, keys are sent raw.

;From the helpfile.

As far as I can tell, your FileReadLine, isnt reading a flag. Or is it?

Well, Basically, we cant really help, seeing as we dont know whats in the file.

Well, I cant really help.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Posted (edited)

#include <GuiConstants.au3>


GUICreate("GUI menu",400,400)

Global $wee2 = FileOpen ( "wee.txt", 0 )
If $wee2 = -1 Then 
    MsgBox ( 0, "Error", "Unable to update." ) 
    Exit 
  EndIf 
Global $QuitIt = HotKeySet ( "{END}", "QuitIt" ) 

;====== QuitIt Function ======================= 

Func QuitIt () 

  FileClose ( $wee2 ) 
  Exit 

  Return 
EndFunc 



$filemenu = GuiCtrlCreateMenu ("File")

$exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu)



$okbutton = GuiCtrlCreateButton ("Update",50,250,70,20)
$cancelbutton = GuiCtrlCreateButton ("Exit",250,250,70,20)

;icon
GuiSetIcon("clan news.exe", 0)

; PIC
GuiCtrlCreatePic("img.jpg",0,0, 400,85)


; DATE
GuiCtrlCreateDate("", 200, 85, 200, 20)

;news crap
GUICtrlCreateLabel("Todays Headline", 75, 85, 85)
$TITLE = GUICtrlCreateInput("", 120, 105, 280, 20)
GUICtrlSetState ( -1, $GUI_FOCUS)
GUICtrlCreateLabel("News", 75, 125, 30)
$TEXT = GUICtrlCreateEdit("",120, 155, 280, 75, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_MULTILINE + $ES_WANTRETURN)



;funtions
GuiSetState()

While 1

$wee3 = FileReadLine ( $wee2 ) 


    $msg = GUIGetMsg()
    

    Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton
            exit

        Case $msg = $exititem
            exit
        
        Case $msg = $okbutton
send ('{tab 4}', $wee3)


    endselect
WEnd

GUIDelete()

Exit

Ok here it is, i want it to send text form the text file in a send command to the text areas.

Edited by backstabbed

tolle indicium

Posted

You still havnt given us this "wee.txt".

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Posted

This? Maybe ...

#include <GuiConstants.au3>

GUICreate("GUI menu",400,400)
$filemenu = GuiCtrlCreateMenu ("File")
$exititem = GuiCtrlCreateMenuitem ("Exit",$filemenu)
$okbutton = GuiCtrlCreateButton ("Update",50,250,70,20)
$cancelbutton = GuiCtrlCreateButton ("Exit",250,250,70,20)
;~ ======================= ======================= ======================= 
Global $iniread_userinputtext = IniRead("C:\__myfile.TXT", "neWS", "LABEL", "")
Global $iniread_userinputtext2 = IniRead("C:\__myfile.TXT", "neWS", "TEXT", "")
;~ ======================= ======================= ======================= 

;icon
GuiSetIcon("clan news.exe", 0)
; PIC
GuiCtrlCreatePic("img.jpg",0,0, 400,85)

; DATE
GuiCtrlCreateDate("", 200, 85, 200, 20)

;news crap
GUICtrlCreateLabel("Todays Headline", 75, 85, 85)
$userinputtext = GUICtrlCreateInput($iniread_userinputtext, 120, 105, 280, 20)
GUICtrlSetState ( -1, $GUI_FOCUS)
GUICtrlCreateLabel("News", 75, 125, 30)
$userinputtext2 = GUICtrlCreateEdit($iniread_userinputtext2,120, 155, 280, 75, $ES_AUTOVSCROLL + $WS_VSCROLL + $ES_MULTILINE + $ES_WANTRETURN)

;funtions
GuiSetState()

While 1
    $msg = GUIGetMsg()
     Select
        Case $msg = $GUI_EVENT_CLOSE Or $msg = $cancelbutton
            exit

        Case $msg = $exititem
            exit
        
 Case $msg = $okbutton
IniWrite("C:\__myfile.TXT", "neWS", "LABEL", GUICtrlRead($userinputtext))
IniWrite("C:\__myfile.TXT", "neWS", "TEXT", GUICtrlRead($userinputtext2))
    endselect
WEnd

Posted

wee.txt has th letters " ad " inside of it ;)

Well, youve got the flag for Send() set as filereadline, so basically, your trying to do this:

Send("{tab 4}", "ad")

Which, doesnt make sense.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Posted (edited)

Double post.

Edited by AzKay
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Posted (edited)

Ok, heres what im eventuallygoing to do, i'm going to do an inet get to my website and download a txt file every day when they click update it well then send the text form the file to the gui and its instant news ;)

-and im checking chie's code now! (doesnt work)

-I'll be back in a couple hours, sorry. (edit2)

Edited by backstabbed

tolle indicium

Posted

Ok, heres what im eventuallygoing to do, i'm going to do an inet get to my website and download a txt file every day when they click update it well then send the text form the file to the gui and its instant news ;)

-and im checking chie's code now!

Forget my code there is mutch more simple way to do it I belive:

#include <IE.au3>
Case $msg = $okbutton
$oIE = _IEcreate("http://www.google.com/",1,1)
_IELoadWait($oIE)
$sText = _IEBodyReadText ($oIE)
MsgBox(0, "Body Text", $sText)
oÝ÷ Ù«­¢+Ø¥¹±Õ±Ðí%¹ÔÌÐì)
ÍÀÌØíµÍôÀÌØí½­ÕÑѽ¸)}%ÉÑ ÅÕ½ÐíÝÝܸ¸¹å½ÕÈÝÁ¹½´½¹Ý̹ÑáÐÅÕ½Ðì°À°À¤ì!¥¸)}%1½]¥Ð ÀÌØí½%¤(ÀÌØíÍQáÐô}%  ½åIQáÐ ÀÌØí½%¤)5Í    ½à À°ÅÕ½Ðí ½äQáÐÅÕ½Ðì°ÀÌØíÍQáФ)}%EեРÀÌØí½%¤
Posted

Even simpler

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", "http://www.site.com/news.txt")
$oHTTP.Send()
MsgBox(0, "News", $oHTTP.Responsetext)
# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Posted

Even simpler

$oHTTP = ObjCreate("winhttp.winhttprequest.5.1")
$oHTTP.Open("GET", "http://www.site.com/news.txt")
$oHTTP.Send()
MsgBox(0, "News", $oHTTP.Responsetext)
oÝ÷ Ûú®¢×¡×£®¶­s`¢6æ6ÇVFRfÇC´uT6öç7FçG2æS2fwC° ¢5&Vvöâ2225D%B¶öFuT6V7Föâ222f÷&ÓТb33c´f÷&ÓÒuT7&VFRgV÷C´f÷&ÓgV÷C²ÂC3BÂ#rÂ2ÂR¢b33c´'WGFöãÒuT7G&Ä7&VFT'WGFöâgV÷C´'WGFöãgV÷C²ÂBÂsrÂ#Â3¢b33c´VFCÒuT7G&Ä7&VFTVFBgV÷C²gV÷C²ÂÂÂC32Âc¤uT7G&Å6WDFFÓÂgV÷C´VFCgV÷C²¤uT6WE7FFR5uõ4õr¢b33c¶ôEEÒö&¤7&VFRgV÷C·væGGçvæGG&WVW7BãRãgV÷C²¢4VæE&Vvöâ222TäB¶öFuT6V7Föâ220 ¥vÆR¢b33c¶ä×6rÒuTvWD×6r¥7vF6b33c¶ä×6p 66Rb33c´uTôUdTåEô4Äõ4P W@ 66Rb33c´'WGFöã uT7G&Å6WDFFb33c´VFCÂgV÷C²gV÷C² b33c¶ôEEä÷VâgV÷C´tUBgV÷C²ÂgV÷C¶GG¢ò÷wwrç6FRæ6öÒöæWw2çGBgV÷C² b33c¶ôEEå6VæB uT7G&Å6WDFFb33c´VFCÂb33c¶ôEEå&W7öç6WFWB¤VæE7vF6¥tVæ@

There ya go, A gui to go with it.

# MY LOVE FOR YOU... IS LIKE A TRUCK- #
Posted

Allright, i'm getting an error, it is

Case $GUI_EVENT_CLOSE

"Case" statement with no matching "select" statement.

p.s

How did you get a scroll bar on your code?

tolle indicium

Posted (edited)

Allright, i'm getting an error, it is

Case $GUI_EVENT_CLOSE

"Case" statement with no matching "select" statement.

How did you get a scroll bar on your code?

Maybe ?
Case $msg =  $GUI_EVENT_CLOSE
[codebox]



			
				


	Edited  by chie
	
	

			
		
Posted

I have already tried the " $msg = " Didnt help same error only with " $msg = " added to it, thanks for helping though!

tolle indicium

Posted

Works fine for me, Do you have the latest BETA?

# MY LOVE FOR YOU... IS LIKE A TRUCK- #

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
×
×
  • Create New...