Jump to content

How to use variables from GUI in script


Milordzie
 Share

Recommended Posts

hi i maked normal tray script. I want put in two functions value from the GUI box how i can do it ?

this is code of my gui for insert data.

#include 
#include 
#include 
#include 
#include 
#Region ### START Koda GUI section ### Form=c:\users\exmple\documents\form1_1.kxf
$Form1_1 = GUICreate("Form1", 637, 334, 192, 124)
$Time = GUICtrlCreateInput("Czas", 464, 80, 121, 21)
$Key = GUICtrlCreateCombo("Klawisz", 464, 48, 169, 25)
GUICtrlSetData(-1, "1|2|3|4|5|6|7|8|9|F1|F2|F3|F4|F5|F6|F7|F8|F9")
$Pic1 = GUICtrlCreatePic("C:\Users\Exmple\Downloads\08a.jpg", -8, -8, 644, 340)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

And this is code of appropriate script.

i want to put in sleep value from $Time

and put value of $Key in ControlSend("Lineage II", "", "", "{here DOWN}")

Global $Paused = False
SoundPlay(@WindowsDir & "\media\Windows Ding.wav", 0)
HotKeySet("{PAUSE}", "TogglePause")
TogglePause()
While 1=1
ControlSend("Lineage II", "", "", "{1 DOWN}")
Sleep($Czas)
WEnd
Func TogglePause()
SoundPlay(@WindowsDir & "\media\Heritage\Windows Error.wav", 0)
$Paused = Not $Paused
While $Paused
Sleep(1000)
ToolTip('Script is "Paused"', 0, 0)
WEnd
ToolTip("")
EndFunc ;==>TogglePause

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd
Link to comment
Share on other sites

  • Moderators

Milordzie,

In your first thread I was suspicious of your use of "xxx" as a title for your controls and suggested that you read the Forum rules. I see now that you are creating a gamebot for "Lineage II" and that I was completely justified. :(

Please read those Forum rules (the link is also at bottom right of each page) - particularly the bit about not discussing game automation - before you post again. Thread locked. :naughty:

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

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