Vindicator209 Posted September 10, 2006 Share Posted September 10, 2006 (edited) Im not sure this belongs here, but how do you add a number thats already a variable? i have this: expandcollapse popup#include <GuiConstants.au3> Global $Attack1 = 200 Global $AttackMin = 1 Global $ARMOR = 100 GuiCreate("Battle!", 222, 418,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Group_1 = GuiCtrlCreateGroup("Player 1", 10, 10, 200, 400) $List_2 = GuiCtrlCreateList("", 20, 30, 180, 110) $Button_3 = GuiCtrlCreateButton("Load", 20, 150, 180, 20) $Combo_4 = GuiCtrlCreateCombo("Chest", 20, 180, 180, 21) $1=GuiCtrlSetData($Combo_4,'Steel Plate') $Combo_5 = GuiCtrlCreateCombo("Legs", 20, 210, 180, 21) $2=GuiCtrlSetData($Combo_5,'Steel Plate Legs') $Combo_6 = GuiCtrlCreateCombo("Weapon", 20, 240, 180, 21) $3=GuiCtrlSetData($Combo_6,'Crystal Katana') $Combo_7 = GuiCtrlCreateCombo("Gloves", 20, 270, 180, 21) $4=GuiCtrlSetData($Combo_7,'Leather Steel-Lined') $Combo_8 = GuiCtrlCreateCombo("MISC. 1", 20, 300, 180, 21) $Combo_9 = GuiCtrlCreateCombo("MISC. 2", 20, 330, 180, 21) $Combo_10 = GuiCtrlCreateCombo("MISC. 3", 20, 360, 180, 21) $Button_11 = GuiCtrlCreateButton("FIGHT!", 20, 390, 180, 20) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $Button_11 If GUICtrlRead($Combo_4) = ('Steel Plate') Then $ARMOR +10 EndIf If GUICtrlRead($Combo_5) = ('Steel Plate Legs') Then $ARMOR +10 EndIf If GUICtrlRead($Combo_6) = ('Crystal Katana') Then $Attack1 +10 $AttackMin + 100 EndIf If GUICtrlRead($Combo_7) = ('Leather Steel-Lined') Then $ARMOR +5 EndIf If GUICtrlRead($Combo_8) = ('God Jewel') Then EndIf If GUICtrlRead($Combo_9) = ('God Ring') Then EndIf If GUICtrlRead($Combo_10) = ('God Amulet') Then EndIf $FIGHT= Random($AttackMin,$Attack1) $Enemy= Random(50,200) If $FIGHT < $Enemy Then MsgBox(0,"Results", "You Lose!") MsgBox(0,"Total", "You Dealt:" $FIGHT "damage" "Your Enemy dealt:" $Enemy "Damage") EndIf If $FIGHT > $Enemy Then MsgBox(0,"Results", "You Win!") MsgBox(0,"Total", "You Dealt:" $FIGHT "damage" "Your Enemy dealt:" $Enemy "Damage") EndIf Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit I bet i have atleast 5 different errors... but i cant figure out how to add a numbr to a variable that already is a number... Edited September 10, 2006 by MethodZero [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
GaryFrost Posted September 10, 2006 Share Posted September 10, 2006 for example: $var += 1 SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Vindicator209 Posted September 10, 2006 Author Share Posted September 10, 2006 for example: $var += 1 oh ok.. thanks [center]"When you look at old, classic games like Snake, you often put it off because it's such a simple game, but it's only when you actually try and create your own unique game from scratch, do you finally appreciate those games."[/center][center]Don't ask for answers if you haven't TRIED yet![/center][center]Most answers can be answered in the help file! Use it![/center] Link to comment Share on other sites More sharing options...
Sunaj Posted September 10, 2006 Share Posted September 10, 2006 Also, for slightly different readability one can do a $var = $var + 1 [list=1][*]Generic way to detect full path to default browser, List/ListView Events Using GuiRegisterMsg (detect doubleclick and much more)[*]Using dllcall for full control over fileopendialog, Make DirMove act somewhat normally (by circumventing it...)[*]Avoid problems with "&" (chr(38)) in code, Change desktop maximized area/workspace (fx to make deskbar type app)[*]Change focus behavior when buttons are clicked to work closer to 'standard windows' app[*](Context) Menus With Timed Tooltips, Fast Loops & Operators in AU3[*]Clipboard UDF, A clipboard change notification udf[/list] Link to comment Share on other sites More sharing options...
GaryFrost Posted September 10, 2006 Share Posted September 10, 2006 Also, for slightly different readability one can do a $var = $var + 1 it's also a slower method SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now