PDA

View Full Version : How to incorporate an "and" to a if not then statement?



jam5796
01-27-2015, 03:14 AM
For my script, im planning to add something like if "this condition" and "not this condition" occurs, then...
How can I do this? sorry if this is a noob question.

KeepBotting
01-27-2015, 03:19 AM
if ((this) and not(that)) then
stuff();

Like that? It will only run stuff(); if this is true and that is false.

jam5796
01-27-2015, 03:21 AM
if ((this) and not(that)) then
stuff();

Like that? It will only run stuff(); if this is true and that is false.

yea that's exactly what im looking for, thanks! :D

jam5796
01-27-2015, 03:32 AM
i bought this message, i am not sure what the unknown type this. im trying to set a waiting time with wait(11000)

Operator "AND" not compatible with types "Unknown" and "(False=0, True=1)" at line 118

KeepBotting
01-27-2015, 03:39 AM
i bought this message, i am not sure what the unknown type this. im trying to set a waiting time with wait(11000)

Operator "AND" not compatible with types "Unknown" and "(False=0, True=1)" at line 118

What's line 118?

jam5796
01-27-2015, 03:53 AM
nevermind, i fixed it with a ttimemarker. However, im still wondering why this doesn't work. Isn't wait a variable?

if wait(16000) and not (bankScreen.isOpen) then

riwu
01-27-2015, 03:55 AM
wait() is a procedure, if statements can only be used with boolean expressions

J_R
01-27-2015, 06:36 AM
nevermind, i fixed it with a ttimemarker. However, im still wondering why this doesn't work. Isn't wait a variable?

if wait(16000) and not (bankScreen.isOpen) then

You want to put the wait before the if statement and just have the check for bankscreen in the if part.

Lipcot
01-27-2015, 05:44 PM
i think that what you are trying to do is wait for the bankscreen to open for 16 seconds?

that would be done this way:


if bankscreen.isOpen(16000) then
stuff;


this will look for the bank for 16 seconds, if it does not open, it will return false and stuff; will not be executed.

note: if the bankscreen is detected between 0 and the 16 seconds it will execute Stuff;

This is because the function bankscreen.isopen() has the possibillity to add a wait time (as an integer) between the brackets.

i hope this was what you were looking for.