Log in

View Full Version : Randomized Walker.Goto("Yay") or Walker.Goto("Nay")



svennn
12-23-2013, 05:16 PM
I want the script to do something like the following:


if (labelName == "DownFloor") then

This is where you come into the picture. I honestly have no idea how to make it randomly choose between different labels.
I want it to randomly choose between 2 (or more) specified labels, and then make the walker go to them.


And since I have already started a thread I might aswell ask for help on another issue.
For my "money withdrawer" I have been using the following segment to decide how much gold the bot should withdraw:

local MoneyToWithdraw = (((ManaPotionCost*(ManaPotionBuy-Self.ItemCount(ManaPotsID)))+(HealthPotionCost*(He althPotionBuy-Self.ItemCount(HealthPotsID)))-(5*(Self.Flasks())))+ExtraMoney)
When I use this script it takes out an exact amount. I would like it to round it up to the closest 1000th amount.

Example: 1800 --> Withdraw 2000
Example: 2001 --> Withdraw 3000


Help is much appreciated.
-- svennn

Furpan
12-23-2013, 05:35 PM
Self.WithdrawMoney(math.random(MoneyToWithdraw, MoneyToWithdraw+difference))
And for random labels, add DownFloor1, DownFloor2
then do

Walker.Goto("DownFloor"..math.random(1,2))

svennn
12-23-2013, 05:44 PM
Self.WithdrawMoney(math.random(MoneyToWithdraw, MoneyToWithdraw+difference))
And for random labels, add DownFloor1, DownFloor2
then do

Walker.Goto("DownFloor"..math.random(1,2))

For the WithdrawMoney, do i need to specify "difference", or is that built in there?

For the random labels, when you say to add DownFloor1 and DownFloor 2, where do you mean that I should add these?

Furpan
12-23-2013, 05:54 PM
For the WithdrawMoney, do i need to specify "difference", or is that built in there?

For the random labels, when you say to add DownFloor1 and DownFloor 2, where do you mean that I should add these?

You'll have to specify difference yourself (it doesn't withdraw in thousand, but random amount).

Here is a part from my venore corym script that uses random labels, hope you can learn from it:


<item text="Random|SpawnAbove:" tag="255"/>
--north is 1 spawnzone
<item text="AboveNorth:" tag="255"/>
<item text="AboveSouthEast:" tag="255"/>
--splits into 2 spawnzones here
<item text="AboveEast:" tag="255"/>
<item text="AboveSouth:" tag="255"/>
<item text="Random|SpawnMain:" tag="255"/>
-- 6 different random spawnzones
<item text="Random1:" tag="255"/>
<item text="Random2:" tag="255"/>
<item text="Random3:" tag="255"/>
<item text="Random4:" tag="255"/>
<item text="Random5:" tag="255"/>
<item text="Random6:" tag="255"/>

elseif (labelName == "Random|SpawnAbove") then
Walker.ConditionalGoto(math.random(1, 2) ~= 1, "AboveSouthEast")

elseif (labelName == "Random|East|South") then
Walker.ConditionalGoto(math.random(1, 2) ~= 1, "AboveEast", "AboveSouth")

elseif (labelName == "Random|SpawnMain") then
Walker.Goto("Random"..math.random(1, 6))

svennn
12-23-2013, 06:24 PM
You'll have to specify difference yourself (it doesn't withdraw in thousand, but random amount).

Here is a part from my venore corym script that uses random labels, hope you can learn from it:


<item text="Random|SpawnAbove:" tag="255"/>
--north is 1 spawnzone
<item text="AboveNorth:" tag="255"/>
<item text="AboveSouthEast:" tag="255"/>
--splits into 2 spawnzones here
<item text="AboveEast:" tag="255"/>
<item text="AboveSouth:" tag="255"/>
<item text="Random|SpawnMain:" tag="255"/>
-- 6 different random spawnzones
<item text="Random1:" tag="255"/>
<item text="Random2:" tag="255"/>
<item text="Random3:" tag="255"/>
<item text="Random4:" tag="255"/>
<item text="Random5:" tag="255"/>
<item text="Random6:" tag="255"/>

elseif (labelName == "Random|SpawnAbove") then
Walker.ConditionalGoto(math.random(1, 2) ~= 1, "AboveSouthEast")

elseif (labelName == "Random|East|South") then
Walker.ConditionalGoto(math.random(1, 2) ~= 1, "AboveEast", "AboveSouth")

elseif (labelName == "Random|SpawnMain") then
Walker.Goto("Random"..math.random(1, 6))

I was nowhere near to understanding. Now I do though, thank you Furpan.

svennn
12-23-2013, 07:25 PM
local YOLO = (math.ceil(MoneyToWithdraw/1000))*1000 would work though... Right?
And then set "Self.WithdrawMoney(YOLO)"

EDIT: Sorry for doublepost, was not my intention.