SRL Archive - OSR Help

"True and" is not needed at line 391


putonajonny

2011-12-12 13:31:57

New Error

Not all of my functions and procedures are shown down the side for quick navigation:




—Old Error—



On compiling I am getting the following warnings:

[Warning] (392:17): "True and" is not needed at line 391
[Warning] (1:1): Calculation always evaluates to True at line 0
[Warning] (1:1): "and True" is not needed at line 0

Lime 391:
  If((LootBones and PtoLB) or (JustLootBones)) then 

obviously I can't paste line 0 but if you want to see the whole script:

'Toxin

2011-12-12 13:37:41

I think your structure is a little off… Refer to this example for proper use of 'If' statements with and's/or's.

http://villavu.com/forum/showthread.php?t=33613

putonajonny

2011-12-15 18:05:54

I still don't have a solution to this, can anybody help, tried Toxins suggestion

Kyle Undefined

2011-12-15 18:14:17


If((LootBones) and (PtoLB)) or (JustLootBones)) then

putonajonny

2011-12-15 18:18:05

From: Camo Developer

If((LootBones) and (PtoLB)) or (JustLootBones)) then


You have one more closing bracket than opening there but even when correcting that I get the same error :(

Kyle Undefined

2011-12-15 18:19:33


If(((LootBones) and (PtoLB)) or (JustLootBones)) then

This?

putonajonny

2011-12-15 18:21:07

From: Camo Developer

If(((LootBones) and (PtoLB)) or (JustLootBones)) then

This?


Nope still same error, would my SRL application get rejected because of this? this is in the script I plan to use

KingKong

2011-12-15 18:23:30

From: putonajonny
Nope still same error, would my SRL application get rejected because of this? this is in the script I plan to use


I doubt you will get rejected because of it. Most people don't even test the script thats being tested. And if you do get rejected you'll know how to improve for next time. So don't worry.

Dgby714

2011-12-15 18:25:17

LootBones or the other one is a constant set to True. It's saying "if (True and Bleh)" is not needed, just use "if (Bleh)".

It's just a warning. Don't worry.

putonajonny

2011-12-15 19:02:07

From: Dgby714
LootBones or the other one is a constant set to True. It's saying "if (True and Bleh)" is not needed, just use "if (Bleh)".

It's just a warning. Don't worry.


Ok, LootBones is a Constant where the user can declare whether to Loot Bones in the script or not, should I change it to a Variable and then set it in a part of the script?

Edit: Done that for that and another boolean and it gets rid of all the errors :)

footballjds

2011-12-15 19:08:20

using a constant is fine.
You're warned because to the computer it is saying: If true is true then do this:
The computers like, well why the hell do i need to check if true is true!? :P

I believe you could use the same method but instead check to see if your constant is true or not true.


If (constant <> false) then PartyInTheUSA;

E: not sure, i am kinda rusty, try it though

putonajonny

2011-12-15 19:31:50

Wouldn't
If (constant <> false) then
do the same thing as
If (constant) then

weequ

2011-12-15 19:39:09

From: putonajonny
Wouldn't
If (constant <> false) then
do the same thing as
If (constant) then
Yup. Atleast if <> applies to booleans. Also same as

if not (boolean = false) then

or this:

if not not boolean then
;)

footballjds

2011-12-15 19:41:11

From: putonajonny
Wouldn't
If (constant <> false) then
do the same thing as
If (constant) then


yes

putonajonny

2011-12-15 19:41:53

From: weequ
Yup. Atleast if <> applies to booleans. Also same as if not (boolean = false)


Yeah I am fairly sure that <> works for booleans just that
If(not boolean) then
is much better than
If(boolean <> true) then
so I don't think that <> would ever be used

footballjds

2011-12-15 19:44:07

From: putonajonny
Yeah I am fairly sure that <> works for booleans just that
If(not boolean) then
is much better than
If(boolean <> true) then
so I don't think that <> would ever be used


ohh, but you know not the powers of <> ;)
don't ever use it the way i said.

Use it with other things ;)