Can someone fix my code? - Printable Version +- BBot - The best bot of the world (https://forums.bmega.net) +-- Forum: Support (https://forums.bmega.net/forum-6.html) +--- Forum: Support & Help (https://forums.bmega.net/forum-8.html) +--- Thread: Can someone fix my code? (/thread-20193.html) |
Can someone fix my code? - lotherad - 08-17-2016 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() 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. RE: Can someone fix my code? - Catar - 08-17-2016 (08-17-2016, 01:02 PM)lotherad Wrote: 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): There are no IFs, elses in bbot macros check one of my macros (on right under my post) to see how 'conditions' work Ok made that macro for u...... idk why, guess i was bored [macro]5000 {rngvialdrop} vialID:=285 Xd:=Self.X() Yd:=Self.Y() Zd:=Self.Z() Rx:=Misc.Random(0, 4) Ry:=Misc.Random(0, 4) VarSub(Rx, 2) VarSub(Ry, 2) VarAdd(Xd, !Rx!) VarAdd(Yd, !Ry!) Map.Thrown(!vialID!, -1, !Xd!, !Yd!, !Zd!) Exit() [/macro] It drops +/- 2 sqm from you |