Jump to content

Calculation Problems


Recommended Posts

Global $ratio = 50

Global $hprtio

If $msg = $button_ratio Then

GUICtrlRead($input_ratio)

$ratio = $input_ratio

$hprtio = Int($ratio * 0.89) + 36

MsgBox(1, "", "hprat:" & $hprtio & " ratio: " & $ratio)

EndIf

For some reason, $ratio always ends up being 3, I'm not understaind why. Could anyone tell me if I'm doing something wrong?

Link to comment
Share on other sites

Is this your entire script?

The below statement is False.The above statement is True.a lesson I learned from Greenmachine; give a man a code and he'll solve one problem. Teach a man to code and he'll solve all his problems.P.S please don't use autoIt as a virus creator/spyware maker(keyLogger especially)Cick this and help me[center]My Scripts:[/center][center]Port Scanner[/center]

Link to comment
Share on other sites

maybe

If $msg = $button_ratio Then
$ratio = GUICtrlRead($input_ratio)
;$ratio = $input_ratio
$hprtio = Int($ratio * 0.89) + 36
MsgBox(1, "", "hprat:" & $hprtio & " ratio: " & $ratio)
EndIf

8)

Thanks, that fixed it!
Link to comment
Share on other sites

what fixed it is u never assigned a variable to the guictrlread

if wanted u can squeeze it all in one line

If $msg = $button_ratio Then
MsgBox(1, "", "hprat:" & Int(GUICtrlRead($input_ratio) * 0.89) + 36 & " ratio: " & GUICtrlRead($input_ratio))
EndIf
More lines is always cooler.. If you say to someone like, i wrote a 3 line script even though it is amazing sounds less cool then i wrote a 600 line script ( and all it did is build 20 GUI's)..
Link to comment
Share on other sites

More lines is always cooler.. If you say to someone like, i wrote a 3 line script even though it is amazing sounds less cool then i wrote a 600 line script ( and all it did is build 20 GUI's)..

ok?

lol im just saying for simplicity purposes, for bragging writes as long as u dont show a person your script u can go with i made a 30,000 line script

Link to comment
Share on other sites

ok?

lol im just saying for simplicity purposes, for bragging writes as long as u dont show a person your script u can go with i made a 30,000 line script

Ha i think it'll be funny if you wrote a random-script creator that you could fill all the lines in for..

Wow, this would come close to a creative AI if you keep rerunning it and run what it has made.

Link to comment
Share on other sites

To illustrate what i'm saying:

$file = FileOpen("RandomScript.au3", 2)

Dim $result
$1 = "Dim $woot"

$result = $result & "Dim $woot" & @CRLF
While 1
    $next = Round(Random(2,10))
    If $next < 4 then
        $result = $result & "MsgBox(0, 'result', $woot)" & @CRLF
        ExitLoop
    Else
        $2 = "$woot = $woot + " & Random(0, 5)
        $result = $result & $2 & @CRLF
    EndIf
WEnd
FileWrite($file, $result)
FileClose($file)
Run('C:\Program Files\AutoIt3\beta\autoit3.exe "D:\RandomScript.au3"')
Link to comment
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
 Share

  • Recently Browsing   0 members

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