Page 1 of 1

Cedric script

Posted: Wed Sep 19, 2012 8:17 am
by Alleexx
I have a script to make all my chars buy dias from cedric but the problem is that sometimes it fails to buy all 3 times.
What I want to do is to make a check after buying the dias to see if the diamond amount has increased by 15 dias. If not I want it to do a player:sleep();

I've tried some different ways but i cannot get it to work. It just continues no matter what

Re: Cedric script

Posted: Wed Sep 19, 2012 10:14 am
by lisa
you will need to either find the diamonds in memory or an ingame function to tell you how many diamonds, after that it should be pretty easy. I thought I had found an ingame function for it a while back but I can't remember it now.

Re: Cedric script

Posted: Wed Sep 19, 2012 10:14 am
by rock5
Try

Code: Select all

local before = RoMScript("GetPlayerMoney(\"account\")")

-- Do your stuff to buy diamonds

if RoMScript("GetPlayerMoney(\"account\")") ~= before + 15 then
    player:sleep()
end

-- continue to log next character

Re: Cedric script

Posted: Thu Sep 20, 2012 8:21 am
by Alleexx
Thanks rock! It works perfectly