Jump to content

Odd Inputbox


NewBe
 Share

Recommended Posts

hmm this might be tricky

I need an inputbox that only accepts numbers but that is not all

$Result = InputBox("Munition" , "what level is your weapon" , "0" , "" , 200 , 50)
MsgBox(0 , "Damage" , "Damage " & $Result)

;if the weapon (result) returns 1 all the way up to 6 then nothing happens but if it is a number above 6 such as 7 the result will return like this

MsgBox(0 , "Damage" , "Damage " & $Result + 100) ;for example... this only happens when the number is over 6

not sure were to begin with this one my head hurts

Link to comment
Share on other sites

Omg you guys are gods... I just woke up and couldn't think of a way to do it so far this is working...

Global $result

$result = InputBox("" , "" , "" , "")

If $result = 0 Or 1 OR 2 Or 3 Or 4 Or 5 Or 6 Then
MsgBox(0 , "" , "bad")
Elseif $result = 6 Then
MsgBox(0 , "Damage" , "Damage " & $Result) ;for example... this only happens when the number is over 6
Endif

now if only I could find away to eliminate letters and make it 6 all the way up to mmm... unlimted and ill be so Happy :P

I am thinking of a way but if you guys got a plan please share it :)

hmm StringIsDigit

Edited by NewBe
Link to comment
Share on other sites

hmm shouldn't this code work exactly correct

;if it isn't a digit exit right away
If StringIsDigit($result) = 0 Then
MsgBox(0 , "" , "exit")
Exit
EndIf
;if it isn't a digit exit right away

;if digit - 0-6 then bad
If $result = 0 Or 1 OR 2 Or 3 Or 4 Or 5 Or 6 Then
MsgBox(0 , "" , "bad")
Else ;it must be a digit over 6?
MsgBox(0 , "Damage" , "Damage " & $Result + 100) ;for example... this only happens when the number is over 6
Endif
Link to comment
Share on other sites

That works, but it could be annyoing when people accidentally type it in.

nah it''s not going to exit that way that was for testing only... all it is doing is this

if weapons are over level 6

$weapon ($result) * 0.025%

you see weapons at level 0 all the way up to 6 have a set damage but if your weapon is any higher it only gives you 0.025% per point

(this is for a game)

Edited by NewBe
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...