Is this non-cheating autoroller possible with LUA?
tortuosit
Member Posts: 63
Hi,
I have no knowledge about LUA. I'd like to make an autoroller which does not cheat, but exactly do what I do, only faster. Below autorolling would feel cheat free for me :-)
a) reroll like 100 times, until I get tired of it
b) 10% chance to miss some good rolls by accidentally clicking over it
c) I'd like to have the autoroll button available only one click per character
Pseudo code:
max = roll();
for i = 1 to 100
{
x = roll();
if ((x > max) && ((random 1) > 0.1) then max = x;
}
TIA
I have no knowledge about LUA. I'd like to make an autoroller which does not cheat, but exactly do what I do, only faster. Below autorolling would feel cheat free for me :-)
a) reroll like 100 times, until I get tired of it
b) 10% chance to miss some good rolls by accidentally clicking over it
c) I'd like to have the autoroll button available only one click per character
Pseudo code:
max = roll();
for i = 1 to 100
{
x = roll();
if ((x > max) && ((random 1) > 0.1) then max = x;
}
TIA
0
Comments
I besically want to get rid of the mouse button killing "1000 times rolling"
Lefreut, or anybody else... (it's WIP), this concept does not seem to enter the for loop which should take some time on this pc.., can you see why? It rolls instantly...
function tort_autoRoll()
-- Tortuosit
if autoroll == 0 then
local rolls = 15000
local fails = 0.1
elseif (autoroll == 1 and rolls > 10) then
rolls = rolls - 10
fails = fails + 0.1
end
createCharScreen:OnAbilityReRollButtonClick()
-- createCharScreen:OnAbilityStoreButtonClick()
local best = chargen.totalRoll
for i = 1,1500000 do
createCharScreen:OnAbilityReRollButtonClick()
if chargen.totalRoll > best and math.random() > fails then
best = chargen.totalRoll
createCharScreen:OnAbilityStoreButtonClick()
end
end
createCharScreen:OnAbilityRecallButtonClick()
autoroll = 1
end
I ended up with an autoroller, which is initialized at entering the character reation. It allows for 7 to 20 roll clicks (where every click picks from 20 -decreasing- rolls), with a decreasing chance of good rolls. Then the button disappears. So some risk and fun is there, but still not unrealistically high rolls. Just time saving.
It's here:
http://pastebin.com/Mn3dYLqg
Init is at CHARGEN menu, with:
onOpen
"
tort_autoroll = 0
tort_fail = 0.05
tort_rolls = 20"