Script seems fine to me...

Started by iwishforpie2, November 20, 2014, 10:17:37 AM

Previous topic - Next topic

iwishforpie2


# SporeTowerAC.crpl
# Created on: 11/20/2014 10:02:30 AM
# ------------------------------------------

GetCreeper CurrentCoords 0 lt if
CreateSpore 20 75 1 GetCreeper CurrentCoords
SetCreeper CurrentCoords 0
endif


Can't seem to figure what I did wrong with the script. Anyone know what I did wrong?
What's a pie? I'm not a pie. I'm a pi.

Aeran01

What do you want to do? if there's any AC in range the tower send a Spore?

iwishforpie2

Yes. It checks if the creeper level on it is less than 0, do it, else repeat until.
What's a pie? I'm not a pie. I'm a pi.

Aeran01

# SporeTowerAC.crpl
# Created on: 11/20/2014 10:02:30 AM
# ------------------------------------------

GetCreeper CurrentCoords 0 lt if
CreateSpore 20 75 1 GetCreeper CurrentCoords
SetCreeper CurrentCoords 0
endif


Ok 20 and 75 are the coordinates?
And SetCreeper why is 0?

iwishforpie2

To remove the AC on the cell so it doesn't use the AC again
What's a pie? I'm not a pie. I'm a pi.

Aeran01

ok try this

GetCreeper CurrentCoords 0 lt if
GetCreeper CurrentX ->XCord
GetCreeper CurrentY ->YCord
CreateSpore 20 75 <-XCord <-YCord 1 100
SetCreeper CurrentCoords 0
endif

Aeran01

I was trying and find something will work but the SetCreeper im not really sure how to use it efectively so here is it

CurrentCoords GetCreeper ->CreeperAmt
if(<-CreeperAmt 0 lt)
CurrentCoords RandCoords 1 100 CreateSpore
CurrentCoords 20 AddCreeper
endif

J

Arguments must be given BEFORE you call the function, so here's the fixed script from the OP:

# SporeTowerAC.crpl
# Created on: 11/20/2014 10:02:30 AM
# ------------------------------------------

CurrentCoords GetCreeper 0 lt if
#Added CurrentCoords because there weren't enough arguments
CurrentCoords 20 75 1 CurrentCoords GetCreeper CreateSpore
CurrentCoords 0 SetCreeper
endif