Jump to content

Recommended Posts

I've put together a little proggy for a game that I play, the interface comes up ok and displayes what you type input (on the Interface), all the buttons work correctly, the only problem I have is:

you can output the interface display to .htm file, but it displays numbers instead of the inputs???, and can't solve it??, it probably something really simple :)

can n e 1 help.

here's the code

#include <GUIConstants.au3>

Opt("GUIOnEventMode", 1)

if FileExists(@desktopdir & "\" & "BR.htm") Then
    msgbox(0,"File Exists", "Using current br.htm", 5)
Else
    FileWrite(@desktopdir & "\" & "BR.htm", "<HTML>" & @CRLF & "<TITLE>BOUNTIES AND RANDOMS RECORDS</TITLE>" & @CRLF & "<BODY BGCOLOR='#C0C0C0'>" & @CRLF)
EndIf

GuiCreate("B&R Recorder", 451, 240,(@DesktopWidth-451)/2, (@DesktopHeight-288)/2 , $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS)
GUISetOnEvent($GUI_EVENT_CLOSE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_MINIMIZE, "SpecialEvents")
GUISetOnEvent($GUI_EVENT_RESTORE, "SpecialEvents")

$Group_1 = GuiCtrlCreateGroup("Bounties and Ransoms", 10, 10, 300, 220)
$Label_2 = GuiCtrlCreateLabel("Claimant", 20, 30, 120, 20)
$c = GUICtrlCreateInput("Input Claimant", 150, 30, 150, 20)

;InputBox("Claimant", "enter claimant")

$Label_2 = GuiCtrlCreateLabel("Target", 20, 55, 120, 20)
$t = GuiCtrlCreateInput("Input Target", 150, 55, 150, 20)

;InputBox("target", "enter Target")

$Label_2 = GuiCtrlCreateLabel("Location", 20, 80, 120, 20)
$l = GuiCtrlCreateInput("Input Location", 150, 80, 150, 20)

;InputBox("Location", "enter Location")

$Label_2 = GuiCtrlCreateLabel("Date", 20, 105, 120, 20)
$d = GUICtrlCreateDate("Select Date", 150, 105, 150, 20)
;@MDAY & "/" & @MON

$Label_2 = GuiCtrlCreateLabel("Time", 20, 130, 120, 20)
$t = GuiCtrlCreateInput(@HOUR & ":" & @MIN, 150, 130, 150, 20)
;@HOUR & ":" & @MIN


$Label_2 = GuiCtrlCreateLabel("Amount", 20, 155, 120, 20)
$a= GUICtrlCreatecombo("Select Amount", 150, 155, 150, 20)
GUICtrlSetData(-1,"5 Million|6 Million|8 Million","Select Amount"); add other item snd set a new default
;InputBox("Amount", "enter amount")

$Label_2 = GuiCtrlCreateLabel("Witnesses", 20, 180, 120, 20)
$w = GuiCtrlCreateInput("Input Witnesses", 150, 180, 150, 20)
;InputBox("witnesses", "enter witnesses")

$Label_2 = GuiCtrlCreateLabel("Screenshot", 20, 205, 120, 20)
$s = GUICtrlCreatecombo("Yes", 150, 205, 150, 20)
GUICtrlSetData(-1,"No","Yes"); add other item snd set a new default
;InputBox("Screenshot available", "yes or no?")

$Group_4 = GuiCtrlCreateGroup("Menu", 320, 10, 120, 220)

$Button_1 = GuiCtrlCreateButton("Add New", 330, 30, 100, 20)
GUICtrlSetOnEvent(-1, "addpressed")

$Button_2 = GuiCtrlCreateButton("Preview", 330, 55, 100, 20)
GUICtrlSetOnEvent(-1, "previewpressed")

$Button_3 = GuiCtrlCreateButton("Reset", 330, 80, 100, 20)
GUICtrlSetOnEvent(-1, "resetpressed")

$Button_4 = GuiCtrlCreateButton("Bounties", 330, 105, 100, 20)
GUICtrlSetOnEvent(-1, "bountiespressed")

$Button_5 = GuiCtrlCreateButton("Ransoms", 330, 130, 100, 20)
GUICtrlSetOnEvent(-1, "ransompressed")

$Button_6 = GuiCtrlCreateButton("Rich.E", 330, 155, 100, 20)
GUICtrlSetOnEvent(-1, "mepressed")

$Button_7 = GuiCtrlCreateButton("About", 330, 180, 100, 20)
GUICtrlSetOnEvent(-1, "aboutpressed")

$Button_8 = GuiCtrlCreateButton("Exit", 330, 205, 100, 20)
GUICtrlSetOnEvent(-1, "exitpressed")

GuiSetState()

GUISetState(@SW_SHOW)

Func addpressed()
    filewrite(@DESKTOPDIR & "\BR.HTM", "<TABLE WIDTH='50%' BORDER='0' CELLSPACING='1' CELLPADDING='4' BGCOLOR='#000000'>" & @CRLF _
    & "<TR BGCOLOR='#EFEFEF'><TD>Claimant:</TD><TD>" & $c & "</TD></TR>" & @CRLF _
    & "<TR BGCOLOR='#EFEFEF'><TD>Target:</TD><TD>" & $t & "</TD></TR>" & @CRLF _
    & "<TR BGCOLOR='#EFEFEF'><TD>Location:</TD><TD>" & $l & "</TD></TR>" & @CRLF _
    & "<TR BGCOLOR='#EFEFEF'><TD>Date/Time:</TD><TD>" & $d & " " & $t & "</TD></TR>" & @CRLF _
    & "<TR BGCOLOR='#EFEFEF'><TD>Amount:</TD><TD>" & $a & "</TD></TR>" & @CRLF _
    & "<TR BGCOLOR='#EFEFEF'><TD>Witnesses:</TD><TD>" & $w & "</TD></TR>" & @CRLF _
    & "<TR BGCOLOR='#EFEFEF'><TD>Screenshot:</TD><TD>" & $s & "</TD></TR>" & @CRLF _
    & "</TABLE><BR><BR>" & @CRLF)
EndFunc

Func previewpressed()
Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE " & @DesktopDir & "\br.htm", "", @SW_MAXIMIZE)
EndFunc

Func resetpressed()
msgbox(48, "Warning!", "reseting your current br.htm file to blank!")
FileDelete(@DesktopDir & "\br.htm")
FileWrite(@desktopdir & "\" & "BR.htm", "<HTML>" & @CRLF & "<TITLE>BOUNTIES AND RANDOMS RECORDS</TITLE>" & @CRLF & "<BODY BGCOLOR='#C0C0C0'>" & @CRLF)
EndFunc

Func bountiespressed()
Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE " & "http://www.topfreelancers.net/phpbb2/viewforum.php?f=72", "", @SW_MAXIMIZE)
EndFunc

Func ransompressed()
Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE " & "http://www.topfreelancers.net/phpbb2/viewforum.php?f=74", "", @SW_MAXIMIZE)
EndFunc

Func mepressed()
Run("C:\Program Files\Internet Explorer\IEXPLORE.EXE " & "http://www.drunkentechie.net", "", @SW_MAXIMIZE)
EndFunc

Func aboutpressed()
msgbox(0, "B&R Recorder", "Version 1" & @CRLF & "Created By Rich.E 2005")
EndFunc


Func exitpressed()
    Msgbox(0, "B&R Recorder", "Thanks for using B&R recorder", 5)
    Exit
EndFunc

Func SpecialEvents()


    Select
        Case @GUI_CTRLID = $GUI_EVENT_CLOSE
            Exit

        Case @GUI_CTRLID = $GUI_EVENT_MINIMIZE

        Case @GUI_CTRLID = $GUI_EVENT_RESTORE

    EndSelect

EndFunc

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

help would be greatly accepted

RichE

[font="'Arial Narrow';"]Current projects[/font]

[font="'Arial Narrow';"]are on my site [/font]Sellostring

Link to post
Share on other sites

the return value of a GUICtrlCreate... is an $ControlID.

You need to use with GUICtrlRead($ControlID) to retrie :) ve the value of the corresponding control

& "<TR BGCOLOR='#EFEFEF'><TD>Claimant:</TD><TD>" & GUICtrlRead($c) & "</TD></TR>" &

have a look at GUICtrlRead doc :D

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...