Sign in to follow this  
Followers 0
Doxie

Calculate several variables

1 post in this topic

#1 ·  Posted (edited)

I'm trying to make a little calculator for a online game which would help me with the game. (No cheating)

Below you can see the layout to get an idea what i'm trying to do.

To left in the GUI, i will add all my own values and to the right in the tab control

i should be able to choose "target" values, and then make a small calculation.

I'm not asking anyone to do this for me, since i'm able to do it myself, almost...

But it was so many years ago since i did any au3 scripting, so its hard to get starting.

As you can see in the layout, i'm using comboboxes, how do i set a value for each line?

Same with the "Story" part of the GUI, i got a listbox, that also need values.

The last tab option called player, is similiar to my own values, so that will just make a simple calculation.

(When i know how to add values to the boxes) :)

Would very much appriciate any help i could get with this.

Please take a look, and maybe just comment my layout.

For example, i made a calculate button on each tab, since i thought it would

be better to have my own stats static, maybe there is a smarter way to do it.

Thanks in advance

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\My Documents\1.kxf
$Form1 = GUICreate("Choose Your Destiny", 486, 309, 1295, 213)
GUISetIcon("D:\005.ico")
$PageControl1 = GUICtrlCreateTab(208, 80, 260, 216)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$TabSheet1 = GUICtrlCreateTabItem("Loom")
$Select = GUICtrlCreateCombo("Select", 224, 120, 145, 25)
GUICtrlSetData(-1, "Drug Addict|Homeless|Prostitute|Pimp|Alcoholic|Drugdealer|Janitor|Fast food clerk|Valet parker|Bank clerk|Electrician|Lawyer|Bouncer|Firefighter|Drug lord|National guard|Police officer|FBI agent|Corporate CEO|Diplomat|Don Guiliano|Head of UN|Army general|President")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Button2 = GUICtrlCreateButton("Calculate", 381, 239, 67, 41, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$TabSheet2 = GUICtrlCreateTabItem("Story")
$List1 = GUICtrlCreateList("", 224, 104, 137, 160)
GUICtrlSetData(-1, "#1 And so it begins|#2 First kill|#3 Training|#4 Terrence Masreedy|#5 Mr. Beaumont|#6 The real Mr. Beamont")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Button1 = GUICtrlCreateButton("Calculate", 390, 238, 67, 41, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$TabSheet3 = GUICtrlCreateTabItem("Player")
$Input1 = GUICtrlCreateInput("Strenght", 222, 111, 120, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Input2 = GUICtrlCreateInput("Tolerance", 222, 141, 120, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Input3 = GUICtrlCreateInput("Intelligence", 222, 169, 120, 22)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Combo1 = GUICtrlCreateCombo("Weapon", 222, 201, 150, 25)
GUICtrlSetData(-1, "Derringer|Retro Beretta|USP Compact|Revolver|Shotgun|Scorpio|Uzi|Mauser|Fox"&Chr(39)&"s gun|Wes"&Chr(39)&"s gun|Indian pistol|Sniper rifle|Repeaster rifle|Cros"&Chr(39)&"s gun|Rolling block pistol|M4|Mounted heavy machinegun|Law missile|Chain gun")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Combo2 = GUICtrlCreateCombo("Armor", 222, 230, 150, 25)
GUICtrlSetData(-1, "Breastplate|World war 1 armor|Sprinter protection|Interceptor body armor|Hightech armor|Wanted armor")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Combo3 = GUICtrlCreateCombo("Equipment", 222, 260, 150, 25)
GUICtrlSetData(-1, "Strangulation wire|Poison ampoule|Grappling hool|Silencer|Costume made armor piercing bullets|Scope|Flash bang|Nigh vision goggles|Loom cloth|Taser|Cornershot|Exploding rats|Viper")
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
$Button4 = GUICtrlCreateButton("Calculate", 392, 243, 67, 41, 0)
GUICtrlSetFont(-1, 8, 400, 0, "Arial")
GUICtrlCreateTabItem("")
$Strenght = GUICtrlCreateInput("Strenght", 16, 80, 120, 21)
$Tolerance = GUICtrlCreateInput("Tolerance", 16, 112, 120, 21)
$Intelligence = GUICtrlCreateInput("Intelligence", 16, 144, 120, 21)
$Weapon = GUICtrlCreateCombo("Weapon", 16, 176, 150, 25)
GUICtrlSetData(-1, "Derringer|Retro Beretta|USP Compact|Revolver|Shotgun|Scorpio|Uzi|Mauser|Fox"&Chr(39)&"s gun|Wes"&Chr(39)&"s gun|Indian pistol|Sniper rifle|Repeaster rifle|Cros"&Chr(39)&"s gun|Rolling block pistol|M4|Mounted heavy machinegun|Law missile|Chain gun")
$Armor = GUICtrlCreateCombo("Armor", 16, 208, 150, 25)
GUICtrlSetData(-1, "Breastplate|World war 1 armor|Sprinter protection|Interceptor body armor|Hightech armor|Wanted armor")
$Equipment = GUICtrlCreateCombo("Equipment", 16, 240, 150, 25)
GUICtrlSetData(-1, "Strangulation wire|Poison ampoule|Grappling hool|Silencer|Costume made armor piercing bullets|Scope|Flash bang|Nigh vision goggles|Loom cloth|Taser|Cornershot|Exploding rats|Viper")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

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

EndSwitch
WEnd
Edited by Doxie

Were ever i lay my script is my home...

Share this post


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
Sign in to follow this  
Followers 0