Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Can someone fix my code?
#1
I'm trying to write the code to throw empty vials at random squares, map looks like this (x - can't throw there, o - able to throw, c - character):

xooooo
ooooco

So basicly I can throw max 4 sqm to the left and 1 to the right, 1 to the up and 1 down so I tried to make it random:

Code:
X:=Self.X()
Y:=Self.Y()
Z:=Self.Z()

RX:=Misc.Random(0,4)

if(!RX!==4)
Y:=Self.Y()
else
Dec(Y, 1)

if(!RX!>1) Dec(X, RX)
else Inc(X, RX)

Map.Thrown(285, 100, X, Y, Z)

But Misc.Random() is returnings numbers like 1336611564.

Can someone fix this and my if...else statements? I'm not sure how to do them in BBot.
Reply


Messages In This Thread
Can someone fix my code? - by lotherad - 08-17-2016, 01:02 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)