ScriptUO

Official ScriptUO EasyUO Scripts => Scripting Chat => Topic started by: exmike on November 27, 2011, 12:11:42 PM

Title: Error with if
Post by: exmike on November 27, 2011, 12:11:42 PM
Please check and tell where error?
Code: [Select]
mainloop:
gosub checksub

sub CheckSub
contpos 0 0
wait 25
savePix 258 167 0
wait 10
if #pixcol = 2705961 {
display ok1
wait 10
} else {
display Exiting
}

wait 10
SavePix 113 167 0
wait 10
if #pixcol = 8710077 {
display Ok
wait 10
} else {
display Exiting2
}
wait 10
savepix 228 240 0
if #pixcol = 2173225 {
display ok3
wait 10
} else {
display exiting3
}
return


if it running it shows Ok1 and Exiting, ok2 and exit\k3 and exit..
how to fix?
Title: Re: Error with if
Post by: Khameleon on November 27, 2011, 02:14:02 PM
we see your willing participate and it looks like you are willing to learn more, please check back with your original new member introduction post to lift your restricted Membership before further postings....



Thank you...
    Not the management.....
Title: Re: Error with if
Post by: 12TimesOver on November 28, 2011, 02:58:19 AM
Check the placement of your brackets. Also, although you CAN use them, you don't HAVE to use brackets with if/else if there is only 1 line to process:

Code: [Select]
if #pixcol = 2705961 ;statement requires brackets since there is two lines to process
   {
   display ok1
   wait 10
   }
else ;brackets are optional since there is only one line
   display Exiting

And yes, please beef up the intro a little bit, unless you don't mind being restricted...

X
Title: Re: Error with if
Post by: exmike on November 28, 2011, 04:35:21 AM
Quote
And yes, please beef up the intro a little bit, unless you don't mind being restricted..
I already wrote in Introduction post, but i have a status :(
How to change it?:(

Sorry because i from other country, and not very good speak in to english :(
Title: Re: Error with if
Post by: Cerveza on November 28, 2011, 05:15:45 AM
Quote
And yes, please beef up the intro a little bit, unless you don't mind being restricted..
I already wrote in Introduction post, but i have a status :(
How to change it?:(

Sorry because i from other country, and not very good speak in to english :(

#1 - read THE RULES (http://www.scriptuo.com/index.php?board=55.0)
#2 - read HOW TO MAKE AN INTRO (http://www.scriptuo.com/index.php?topic=1683.0)
#3 - read GOOD INTRO EXAMPLES (http://www.scriptuo.com/index.php?board=20.0)

Just do that before you post anything else.
Title: Re: Error with if
Post by: Crome969 on November 28, 2011, 05:29:30 AM
Quote
And yes, please beef up the intro a little bit, unless you don't mind being restricted..
I already wrote in Introduction post, but i have a status :(
How to change it?:(

Sorry because i from other country, and not very good speak in to english :(
From where are you from? maybe some member coming from the same Country and could translate you what you will have to do.
Else i would prefer using Google Translator they are quite good..
Title: Re: Error with if
Post by: TrailMyx on November 28, 2011, 07:41:12 AM
Check the placement of your brackets. Also, although you CAN use them, you don't HAVE to use brackets with if/else if there is only 1 line to process:

What 12X is bringing up is one of a 100 little syntactical formatting annoyances you'll run into when you script in EUO.  Best thing you can do is look at how other people have their code formatted and try and follow that convention.  Also, code in small bits and test as you go.  If you try and code a huge block of code and you have a syntactical error, you'll spend countless hours trying to find it since EUO doesn't fail execution when it runs into a syntax error.   
Title: Re: Error with if
Post by: Crome969 on November 28, 2011, 08:28:37 AM
If you dont know how to check all the Logical Brackets,you have 3 Opinions:

Best Case :
Quote
And yes, please beef up the intro a little bit, unless you don't mind being restricted..
I already wrote in Introduction post, but i have a status :(
How to change it?:(

Sorry because i from other country, and not very good speak in to english :(

#1 - read THE RULES (http://www.scriptuo.com/index.php?board=55.0)
#2 - read HOW TO MAKE AN INTRO (http://www.scriptuo.com/index.php?topic=1683.0)
#3 - read GOOD INTRO EXAMPLES (http://www.scriptuo.com/index.php?board=20.0)

Just do that before you post anything else.
And get Access to Scriptuo Development Tool for Easyuo.
Other Okay Case:
Use Notepad++ and get the Bracket marks
Baddest Case: Use Easyuo Only

Now it really depending all on you.

Crome
Title: Re: Error with if
Post by: dxrom on November 28, 2011, 12:47:47 PM
http://www.scriptuo.com/index.php?topic=8961.0