Jump to content
Sign in to follow this  
GeekS

$FCRTotal outcome always above 152

Recommended Posts

GeekS

Excuse("Random excuse here for being noob")

I'm currently doing a script for Diablo 2, which is calculating out some different breakpoints from the stats of all gear. But i'm currently having some trouble with the $Input , because it seems that no matter what number input is inserted, the outcome is always above 152.

Here's the gui inputs:

#Region ### START Koda GUI section ### Form=
$Form3 = GUICreate("Form3", 633, 447, 285, 315)
$Button1 = GUICtrlCreateButton("FCR Bps", 528, 16, 89, 33, 0)
$Button2 = GUICtrlCreateButton("FHR Bps", 528, 56, 89, 33, 0)
$Button3 = GUICtrlCreateButton("FBR Bps 1hand", 528, 96, 89, 33, 0)
$Button5 = GUICtrlCreateButton("Exit", 520, 376, 97, 57, 0)
$Label1 = GUICtrlCreateLabel("Amazon", 16, 16, 42, 17)
$Button4 = GUICtrlCreateButton("FBR Bps 2hand", 528, 136, 89, 33, 0)
$Group1 = GUICtrlCreateGroup("Helm", 128, 56, 49, 89)
$Input1 = GUICtrlCreateInput("Fcr", 136, 72, 33, 21)
$Input2 = GUICtrlCreateInput("Fhr", 136, 96, 33, 21)
$Input3 = GUICtrlCreateInput("Res", 136, 120, 33, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group3 = GUICtrlCreateGroup("Amulet", 184, 56, 49, 89)
$Input4 = GUICtrlCreateInput("Fcr", 192, 72, 33, 21)
$Input5 = GUICtrlCreateInput("Fhr", 192, 96, 33, 21)
$Input6 = GUICtrlCreateInput("Res", 192, 120, 33, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group4 = GUICtrlCreateGroup("Weapon", 72, 160, 49, 89)
$Input7 = GUICtrlCreateInput("Fcr", 80, 176, 33, 21)
$Input8 = GUICtrlCreateInput("Fhr", 80, 200, 33, 21)
$Input9 = GUICtrlCreateInput("Res", 80, 224, 33, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group5 = GUICtrlCreateGroup("Armor", 128, 160, 49, 89)
$Input10 = GUICtrlCreateInput("Fcr", 136, 176, 33, 21)
$Input11 = GUICtrlCreateInput("Fhr", 136, 200, 33, 21)
$Input12 = GUICtrlCreateInput("Res", 136, 224, 33, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group6 = GUICtrlCreateGroup("Off-hand", 184, 160, 49, 89)
$Input13 = GUICtrlCreateInput("Fcr", 192, 176, 33, 21)
$Input14 = GUICtrlCreateInput("Fhr", 192, 200, 33, 21)
$Input15 = GUICtrlCreateInput("Res", 192, 224, 33, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group7 = GUICtrlCreateGroup("Gloves", 16, 264, 49, 89)
$Input16 = GUICtrlCreateInput("Fcr", 24, 280, 33, 21)
$Input17 = GUICtrlCreateInput("Fhr", 24, 304, 33, 21)
$Input18 = GUICtrlCreateInput("Res", 24, 328, 33, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group8 = GUICtrlCreateGroup("Ring 1", 72, 264, 49, 89)
$Input19 = GUICtrlCreateInput("Fcr", 80, 280, 33, 21)
$Input20 = GUICtrlCreateInput("Fhr", 80, 304, 33, 21)
$Input21 = GUICtrlCreateInput("Res", 80, 328, 33, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group9 = GUICtrlCreateGroup("Belt", 128, 264, 49, 89)
$Input22 = GUICtrlCreateInput("Fcr", 136, 280, 33, 21)
$Input23 = GUICtrlCreateInput("Fhr", 136, 304, 33, 21)
$Input24 = GUICtrlCreateInput("Res", 136, 328, 33, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group10 = GUICtrlCreateGroup("Ring 2", 184, 264, 49, 89)
$Input25 = GUICtrlCreateInput("Fcr", 192, 280, 33, 21)
$Input26 = GUICtrlCreateInput("Fhr", 192, 304, 33, 21)
$Input27 = GUICtrlCreateInput("Res", 192, 328, 33, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group11 = GUICtrlCreateGroup("Boots", 240, 264, 49, 89)
$Input28 = GUICtrlCreateInput("Fcr", 248, 280, 33, 21)
$Input29 = GUICtrlCreateInput("Fhr", 248, 304, 33, 21)
$Input30 = GUICtrlCreateInput("Res", 248, 328, 33, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Group12 = GUICtrlCreateGroup("Charms", 88, 368, 129, 41)
$Input31 = GUICtrlCreateInput("Fcr", 96, 384, 33, 21)
$Input32 = GUICtrlCreateInput("Fhr", 136, 384, 33, 21)
$Input33 = GUICtrlCreateInput("Res", 176, 384, 33, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button6 = GUICtrlCreateButton("Your stats", 256, 184, 81, 57, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

Then the script is reading the numbers input from the gui:

$FCRHelm = GUICtrlRead($Input1)
$FCRAmulet = GUICtrlRead($Input4)
$FCRWeapon = GUICtrlRead($Input7)
$FCRArmor = GUICtrlRead($Input10)
$FCRShield = GUICtrlRead($Input13)
$FCRGloves = GUICtrlRead($Input16)
$FCRRing1 = GUICtrlRead($Input19)
$FCRBelt = GUICtrlRead($Input22)
$FCRRing2 = GUICtrlRead($Input25)
$FCRBoots = GUICtrlRead($Input28)
$FCRCharms = GUICtrlRead($Input31)

$FCRTotal = $FCRHelm + $FCRAmulet + $FCRWeapon + $FCRArmor + $FCRShield + $FCRGloves + $FCRRing1 + $FCRBelt + $FCRRing2 + $FCRBoots + $FCRCharms

And following i want it to determine in between which numbers the TOTAL amount of inputs adds up to.

$FCRBreakpoint = 0
IF 0 < $FCRTotal < 7 Then
        $FCRBreakpoint = 0
EndIf
If 7 < $FCRTotal < 14 Then
        $FCRBreakpoint = 7
EndIf
If 7 = $FCRTotal Then
        $FCRBreakpoint = 7
EndIf
If 14 < $FCRTotal < 22 Then
        $FCRBreakpoint = 14
EndIf
If 14 = $FCRTotal Then
        $FCRBreakpoint = 14
EndIf
If 22 < $FCRTotal < 32 Then
        $FCRBreakpoint = 22
EndIf
If 22 = $FCRTotal Then
        $FCRBreakpoint = 22
EndIf
If 32 < $FCRTotal < 48 Then
        $FCRBreakpoint = 32
EndIf
If 32 = $FCRTotal Then
        $FCRBreakpoint = 32
EndIf
If 48 < $FCRTotal < 68 Then
        $FCRBreakpoint = 48
EndIf
If 48 = $FCRTotal Then
        $FCRBreakpoint = 48
EndIf
If 68 < $FCRTotal < 99 Then
        $FCRBreakpoint = 68
EndIf
If 68 = $FCRTotal Then
        $FCRBreakpoint = 68
EndIf
If 99 < $FCRTotal < 152 Then
        $FCRBreakpoint = 99
EndIf
If 99 = $FCRTotal Then
        $FCRBreakpoint = 99
EndIf
If 152 < $FCRTotal < 1000 Then
        $FCRBreakpoint = 152
EndIf
If 152 = $FCRTotal Then
        $FCRBreakpoint = 152
EndIf

At the end, i want a 'pop-up' GUI to tell in between what numbers the inputs is:

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Lasse\Skrivebord\koda_1.7.0.1\Forms\Infoscreen.kxf
$Form1 = GUICreate("Form1", 273, 185, 191, 121)
$Group1 = GUICtrlCreateGroup("Group1", 8, 8, 257, 169)
$Label1 = GUICtrlCreateLabel("Your faster cast rate:", 16, 24, 102, 17)
$Label2 = GUICtrlCreateLabel("Your faster cast rate breakpoint:", 16, 40, 155, 17)
$Label3 = GUICtrlCreateLabel("Your faster hit recovery:", 16, 80, 116, 17)
$Label4 = GUICtrlCreateLabel("Your faster hit recovery breakpoint:", 16, 96, 169, 17)
$Label5 = GUICtrlCreateLabel("Your all resistance:", 16, 136, 93, 17)
$Label6 = GUICtrlCreateLabel("Your all resistance on hell:", 16, 152, 127, 17)
$Label7 = GUICtrlCreateLabel($FCRTotal, 200, 24, 25, 17)
$Label8 = GUICtrlCreateLabel($FCRBreakpoint, 200, 40, 42, 17)
$Label9 = GUICtrlCreateLabel($FHRTotal, 200, 80, 26, 17)
$Label10 = GUICtrlCreateLabel("FHR BP", 200, 96, 43, 17)
$Label11 = GUICtrlCreateLabel($RESTotal, 200, 136, 26, 17)
$Label12 = GUICtrlCreateLabel("RES Hell", 200, 152, 47, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

But no matter what, $Label8 = GUICtrlCreateLabel($FCRBreakpoint, 200, 40, 42, 17) ALWAYS ends up showing 152 breakpoint. I have NO clue at all why this is.

Sorry if this is in any ways hard to understand (At least i'm having trouble explaining it). Thanks in advance, GeekS / Gnu.

(Full script attached & ready to run, only amazon is edited yet tho)

GNUcalculator_1.2.au3

Edited by GeekS

Share this post


Link to post
Share on other sites
andybiochem

You have a bit of a syntax problem here.

Change every one of your IF > EndIfs in the following way...

IF 0 < $FCRTotal < 7 Then
        $FCRBreakpoint = 0
EndIf
If 7 < $FCRTotal < 14 Then
        $FCRBreakpoint = 7
EndIfoÝ÷ ÙÈZ¬¶®¶­sdbb33c´d5%F÷FÂfwC³ÒæBb33c´d5%F÷FÂfÇC²rFVà¢b33c´d5$'&V·öçBÒ¤VæD`¤bb33c´d5%F÷FÂfwC³ÒræBb33c´d5%F÷FÂfÇC²BFVà¢b33c´d5$'&V·öçBÒp¤VæD`

etc etc

p.s. your script is crying out for some nice loops!


- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!

Share this post


Link to post
Share on other sites
GeekS

Any ideas of how to including some loops into my script is welcome :P, one of my first times really working out on the GUI area.

Anyways, ty alot for the help Andy, seems to work out just fine now.

Share this post


Link to post
Share on other sites
andybiochem

For example, you can replace:

$FCRBreakpoint = 0
IF 0 < $FCRTotal < 7 Then
        $FCRBreakpoint = 0
EndIf
If 7 < $FCRTotal < 14 Then
        $FCRBreakpoint = 7
EndIf
If 7 = $FCRTotal Then
        $FCRBreakpoint = 7
EndIf
If 14 < $FCRTotal < 22 Then
        $FCRBreakpoint = 14
EndIf
If 14 = $FCRTotal Then
        $FCRBreakpoint = 14
EndIf
If 22 < $FCRTotal < 32 Then
        $FCRBreakpoint = 22
EndIf
If 22 = $FCRTotal Then
        $FCRBreakpoint = 22
EndIf
If 32 < $FCRTotal < 48 Then
        $FCRBreakpoint = 32
EndIf
If 32 = $FCRTotal Then
        $FCRBreakpoint = 32
EndIf
If 48 < $FCRTotal < 68 Then
        $FCRBreakpoint = 48
EndIf
If 48 = $FCRTotal Then
        $FCRBreakpoint = 48
EndIf
If 68 < $FCRTotal < 99 Then
        $FCRBreakpoint = 68
EndIf
If 68 = $FCRTotal Then
        $FCRBreakpoint = 68
EndIf
If 99 < $FCRTotal < 152 Then
        $FCRBreakpoint = 99
EndIf
If 99 = $FCRTotal Then
        $FCRBreakpoint = 99
EndIf
If 152 < $FCRTotal < 1000 Then
        $FCRBreakpoint = 152
EndIf
If 152 = $FCRTotal Then
        $FCRBreakpoint = 152
EndIfoÝ÷ Û­«­¢+Ù¥´ÀÌØí±lÄÁtôlÅÕ½ÐìÅÕ½Ðì°À°Ü°ÄаÈÈ°ÌÈ°Ðà°Øà°ää°ÄÔÉt(ÀÌØí
I   É­A½¥¹ÐôÄÔÈ)½ÈÀÌØí¤ôÄѼà(%%ÀÌØí
IQ½Ñ°ÐìôÀÌØí±lÀÌØí¥t¹ÀÌØí
IQ½Ñ°±ÐìÀÌØí±lÀÌØí¤¬ÅtQ¡¸ÀÌØí
I   É­A½¥¹ÐôÀÌØí±lÀÌØí¥t)9áÐ

nice and short!


- Table UDF - create simple data tables - Line Graph UDF GDI+ - quickly create simple line graphs with x and y axes (uses GDI+ with double buffer) - Line Graph UDF - quickly create simple line graphs with x and y axes (uses AI native graphic control) - Barcode Generator Code 128 B C - Create the 1/0 code for barcodes. - WebCam as BarCode Reader - use your webcam to read barcodes - Stereograms!!! - make your own stereograms in AutoIT - Ziggurat Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Box-Muller Gaussian Distribution RNG - generate random numbers based on normal/gaussian distribution - Elastic Radio Buttons - faux-gravity effects in AutoIT (from javascript)- Morse Code Generator - Generate morse code by tapping your spacebar!

Share this post


Link to post
Share on other sites
GeekS

Guess i need to learn a bit more about arrays before importing that into my script, but i'll give it a try.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.