Randomize move-command target

All resolved question will be found here. It is recommended that you browse / search through this section first and see if your question has been answered before

Moderators: Moderators, Documentation Writers

Daedalus
Plain Yogurt
Plain Yogurt
Posts: 73
Joined: 09 Nov 2010, 16:20
Noob?: No

Randomize move-command target

#1 Post by Daedalus »

I thought about it and did not get a clue how I could randomize the target of "move" to a specified area like the "location" status.
VashTheStampede
Plain Yogurt
Plain Yogurt
Posts: 68
Joined: 11 Jun 2011, 01:47
Noob?: No

Re: Randomize move-command target

#2 Post by VashTheStampede »

You mean like this?

Code: Select all

$mapselect = @rand(1,3)
if ($mapselect == 1) do move prt_fild01
if ($mapselect == 2) do move izlude
if ($mapselect == 3) do move pay_dun04
Daedalus
Plain Yogurt
Plain Yogurt
Posts: 73
Joined: 09 Nov 2010, 16:20
Noob?: No

Re: Randomize move-command target

#3 Post by Daedalus »

It works like that in macros? If so it looks promising and gives me a way to solve it, thanks.

I use it so my char doesn't walk to the same spot all the time but on different ones. :)
glennlevi
Plain Yogurt
Plain Yogurt
Posts: 58
Joined: 19 May 2011, 00:40
Noob?: Yes

Re: Randomize move-command target

#4 Post by glennlevi »

do you guys know how to configure a macro to make the bot move one block from where it's standing? Sometimes my bot gets stuck when attacking, and one way of getting it unstuck is moving it. Please help me.

automacro moveOneBlock1 {
console /cannot reach or damage target/
call moveOneBlock2
}

macro moveOneBlock2 {
do (???)
}

Help please.
User avatar
SkylorD
Moderators
Moderators
Posts: 1197
Joined: 16 Dec 2011, 02:53
Noob?: No
Location: Brazil

Re: Randomize move-command target

#5 Post by SkylorD »

the bot move one block from where it's standing?
x or y ?
Try this :

http://openkore.com/index.php/Category:Movement

Or :
$x = @eval (return $::char->{pos}{x})
$y = @eval (return $::char->{pos}{y})
$newy = @eval ($y + 1)
$newx = @eval ($x + 1)
do move $newx $newy
It's 1 in 500 way.
Learn rules
glennlevi
Plain Yogurt
Plain Yogurt
Posts: 58
Joined: 19 May 2011, 00:40
Noob?: Yes

Re: Randomize move-command target

#6 Post by glennlevi »

Thanks a lot :D