Khaos
Master
Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11
|
RE: Gold -> Bag -> Bank
Did you still need help with this? If so, Coruja's works. Just change Layer_BackPack to Layer_BankBox. Kanibals is a good example too. Just change out that var to a local. Var's are globally stored and no one is clearing out this Var I am noticing.
Also. Xun is right, Gold function will send it right to the bank, but without a container.
Coruja says NewGold will work, but it doesn't go to the bank, as it has no bounce option. It actually is stored to the <Src> who called that function. Meaning it would just go in their backpack or a chest if a chest called it. Just whatever is calling the function is where that Gold is stored.
This just leaves you with two While options from Coruja and Kanibal, which are the best option for what you are trying to achieve as a While parses until it returns false. Both of their function do this and then take the remainder and drop it in the bag (or in the backpack in Coruja's example, which can be changed to a bag).
Coruja's is accurate without storing anything in a global Var, but in the long run Kanibal's is the most ideal as it doesn't parse the conditional Else and has already been lowering the Var the entire time to dump it in the bag when While returns False. Just change his Vars to locals as I stated.
Also, Kanibal's method for calling Layer 29 is correct, while I saw people calling for layer_backpack.
Also, change Kanibal's Src.Update to Src.Resend. Update is called from an Item and Resend refreshes the Client's screen, whom is your recipient. Both are good, but in this case, Resend is probably what you truly want. If this is being parsed from the player as the <Src>, Resend is your function for updating you want.
(This post was last modified: 03-01-2016 12:18 PM by Khaos.)
|
|
03-01-2016 12:13 PM |
|
|
Llirik
Journeyman
Posts: 116
Likes Given: 0
Likes Received: 10 in 8 posts
Joined: Feb 2015
Reputation: 0
UO Forum
|
RE: Gold -> Bag -> Bank
(03-01-2016 12:13 PM)Khaos Wrote: Did you still need help with this? If so, Coruja's works. Just change Layer_BackPack to Layer_BankBox. Kanibals is a good example too. Just change out that var to a local. Var's are globally stored and no one is clearing out this Var I am noticing.
Also. Xun is right, Gold function will send it right to the bank, but without a container.
Coruja says NewGold will work, but it doesn't go to the bank, as it has no bounce option. It actually is stored to the <Src> who called that function. Meaning it would just go in their backpack or a chest if a chest called it. Just whatever is calling the function is where that Gold is stored.
This just leaves you with two While options from Coruja and Kanibal, which are the best option for what you are trying to achieve as a While parses until it returns false. Both of their function do this and then take the remainder and drop it in the bag (or in the backpack in Coruja's example, which can be changed to a bag).
Coruja's is accurate without storing anything in a global Var, but in the long run Kanibal's is the most ideal as it doesn't parse the conditional Else and has already been lowering the Var the entire time to dump it in the bag when While returns False. Just change his Vars to locals as I stated.
Also, Kanibal's method for calling Layer 29 is correct, while I saw people calling for layer_backpack.
Also, change Kanibal's Src.Update to Src.Resend. Update is called from an Item and Resend refreshes the Client's screen, whom is your recipient. Both are good, but in this case, Resend is probably what you truly want. If this is being parsed from the player as the <Src>, Resend is your function for updating you want.
I can use?
[FUNCTION f_add_gold]
serv.newitem i_bag, 1, <findlayer.29.uid>
local.newbag = <new.uid>
local.money = <argn>
if <local.money> > 65000
while <local.money> > 65000
serv.newitem i_gold, 65000, <local.newbag>
local.money -= 65000
endwhile
serv.newitem i_gold, <local.money>, <local.newbag>
else
serv.newitem i_gold, <local.money>, <local.newbag>
endif
update
local=var? In this function only.
Sorry my English isn't good!
(This post was last modified: 03-01-2016 12:26 PM by Llirik.)
|
|
03-01-2016 12:23 PM |
|
|