I need a simple persistent script which will transfer money from my bank account to another one every hour.
I'm a newbie in scripting, so maybe I gonna explain You how should it work and You gonna just translate it into lua language, its pretty simple for someone who know it a bit.
So how this script should work;
1. Every one hour check if NPC chat is open then;
if not, then;
open the NPC chat, then;
(or) if opened, then;
2. Say "Hi", "Balance", then;
if account balance <XXX gps, then;
say "Bye"; then;
Close NPC chat;
(or) if account balance >XXX gps, then;
say "Transfer", "YYY gps - standard XXX gps some", "<character name>", then;
say "Bye"; then;
Close NPC chat;
So for example, if standard some of gps is 1000 gps, it would looks like this:
1. Every one hour check if NPC chat is open then;
if not, then;
open the NPC chat, then;
(or) if opened, then;
2. Say "Hi", "Balance", then;
if account balance 800 (<1000) gps, then;
say "Bye"; then;
Close NPC chat;
(or) if account balance 1200 (>1000) gps, then;
say "Transfer", "200 (1200-1000=200)", "<Banana Eater>", then;
say "Bye"; then;
Close NPC chat;
Hope You will help me! Thank You very much friends!
08-31-2014, 08:07 PM
Diaxy
Add this part to your bank action.
init start
local AmountToSave = 1000 -- in gold
local nick = "Tomurka" -- character to transfer gold
init end
npcsay("balance")
if $balance > AmountToSave then
npcsay("transfer "..$balance-AmountToSave.." to "..nick)
wait(500,1000)
npctalk("yes")
wait(500,1000)
npcsay("balance")
end
08-31-2014, 08:54 PM
madma
Thanks buddy, just tell me if I wanna that script will be repeated every 30 minutes i can put on script:
auto ()
But what's the value for 30 minutes? 180000?
08-31-2014, 09:07 PM
Diaxy
Quote:
Originally Posted by madma
Thanks buddy, just tell me if I wanna that script will be repeated every 30 minutes i can put on script:
auto ()
But what's the value for 30 minutes? 180000?
Are you going to use script just to transfer money, or you gonna exp too?
08-31-2014, 09:15 PM
madma
Just for transfer money buddy, as persistant script, there is no need to set location cause I put my character always on bank in thais, so if he say "hi" he will automatically speak with the npc behind him
09-01-2014, 06:08 PM
Dehan
Quote:
Originally Posted by madma
Just for transfer money buddy, as persistant script, there is no need to set location cause I put my character always on bank in thais, so if he say "hi" he will automatically speak with the npc behind him
you can use
auto(30*60*1000)
1000 = 1 second, 60 = 60 seconds = 1 minute, 30 = 30 minutes
so the math result will be exactly 30 minutes.