Jump to content

GUICtrlSetData setting too much?!


layer
 Share

Recommended Posts

hey, i was just wondering... what is the dealio with this below portion of code?

ProgressOn ("Getting IP...", "Getting the public IP address needed...")
InetGet("http://www.whatismyip.org", "publicIP.tmp")
ProgressSet (25)
$publicIP = FileReadLine("publicIP.tmp")
ProgressSet(50)
GUICtrlSetData($Input_2, $publicIP)
ProgressSet(75)
FileDelete("publicip.tmp")
ProgressSet (100)
ProgressOff ()

it should show a progress, get the publicIP from whatismyip.org, delete it, set the gui controls data with the ip from whatismyip.org and delete the .tmp and turn the progress off... lol, for some reason it returns

12.345.678.9XXX.12.345.678

thats just a fake ip, duh, but i know its not that long! i went to the site just to double check, and opened the .tmp file to check too, no luck... any ideas? and the GUI is barely built yet... just a basic if $get=-3 then exit loop... why would it do this?! :lmao:

FootbaG
Link to comment
Share on other sites

lol... sorry, as u can see, i just started it...its name is even still MyGUI

; Script generated by AutoBuilder 0.5 Prototype

#include <GuiConstants.au3>

If Not IsDeclared('WS_CLIPSIBLINGS') Then Global $WS_CLIPSIBLINGS = 0x04000000

GuiCreate("MyGUI", 455, 280,(@DesktopWidth-455)/2, (@DesktopHeight-280)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)

$Label_1 = GuiCtrlCreateLabel("Your IP: ", 20, 170, 40, 20)
$Input_2 = GuiCtrlCreateInput("", 90, 170, 110, 20)
$Label_3 = GuiCtrlCreateLabel("Friends IP: ", 20, 120, 50, 20)
$Input_4 = GuiCtrlCreateInput("", 90, 120, 110, 20)
$Group_5 = GuiCtrlCreateGroup("Welcome to SweetTalk", 20, 10, 160, 90)
$Label_6 = GuiCtrlCreateLabel("Welcome to SweetTalk!", 30, 30, 120, 20)
$Label_7 = GuiCtrlCreateLabel("Just enter your friends IP", 30, 50, 120, 20)
$Label_8 = GuiCtrlCreateLabel("and hit connect!", 30, 70, 120, 20)
$Button_9 = GuiCtrlCreateButton("Connect", 310, 190, 100, 50)
ProgressOn ("Getting IP...", "Getting the public IP address needed...")
InetGet("http://www.whatismyip.org", "publicIP.tmp")
ProgressSet (25)
$publicIP = FileReadLine("publicIP.tmp")
ProgressSet(50)
GUICtrlSetData($Input_2, $publicIP)
ProgressSet(75)
FileDelete("publicip.tmp")
ProgressSet (100)
ProgressOff ()


GUICtrlSetData ($Input_2, $publicIP, 1)

GuiSetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;
    EndSelect
WEnd
Exit

now im thinking of just stopping the project though... i just have too much going on its hard to work, but i'd still like to see what the solution is for this, thanks! :lmao:

FootbaG
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...