SRL Archive - RS3 Help

How to incorporate an "and" to a if not then statement?


jam5796

2015-01-26 22:14:23

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

2015-01-26 22:19:18

if ((this) and not(that)) then
stuff();

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

jam5796

2015-01-26 22:21:50

From: KeepBotting
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

2015-01-26 22:32:17

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

2015-01-26 22:39:12

From: jam5796
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

2015-01-26 22:53:41

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

2015-01-26 22:55:21

wait() is a procedure, if statements can only be used with boolean expressions

J_R

2015-01-27 01:36:47

From: jam5796
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

2015-01-27 12:44:10

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.