Gold -> Bag -> Bank - Printable Version +- SphereCommunity (https://forum.spherecommunity.net) +-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d) +--- Forum: Script Help (/Forum-Script-Help) +--- Thread: Gold -> Bag -> Bank (/Thread-Gold-Bag-Bank) |
RE: Gold -> Bag -> Bank - Khaos - 03-02-2016 12:07 AM The else is needed. It actually is parsing if the first line is more than 65000. Where as the else gets called if it is less than or equal. Thanks for reminding me about this thought Pointz!!! Need to try and play with forcing NewGold to bounce that gold in a bag in his bank box. RE: Gold -> Bag -> Bank - Llirik - 03-02-2016 01:22 AM [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 endif serv.newitem i_gold, <local.money>, <local.newbag> update Work well! I take it! RE: Gold -> Bag -> Bank - Khaos - 03-02-2016 04:15 AM Awesome. If I simplify it more, I will let you know. Remember, try to avoid var on the 56 servers unless you want it globally saved. RE: Gold -> Bag -> Bank - pointhz - 03-02-2016 04:36 AM What else does the function need to do ? Isnt it just add the gold to a bag inside bankbox? RE: Gold -> Bag -> Bank - Khaos - 03-02-2016 07:10 AM Yes, but I am trying to get it to call NewGold from the bag so it parses less internally. Serv.NewItem calls for item, amount, and cont/equip. NewGold just parses amount and drops it into <Src>. So if you can switch to be called from the Bag itself, it is less memory consuming. Optimization for memory is always key. RE: Gold -> Bag -> Bank - Khaos - 03-18-2016 07:53 PM Llirik sweetie. Test this. Think I just did what you wanted in three lines of code. Code: [Function AddGold] RE: Gold -> Bag -> Bank - Llirik - 03-19-2016 07:35 PM 12:34:ERROR:(stone_money.scp,60)Can't trysrc NewGold 1000 object Kirill (01bb10): invalid src uid 040019672 RE: Gold -> Bag -> Bank - Khaos - 03-20-2016 05:11 AM Awww let me see what is going on! Thanks for testing it for me though!! RE: Gold -> Bag -> Bank - Llirik - 03-20-2016 07:42 PM I'm not understand! You need get my TeamViewer? RE: Gold -> Bag -> Bank - pointhz - 03-23-2016 08:53 AM that newgold is most likely hard coded to check if the src is a character, or has a backpack, or something. Not that I understand anything about what is hard coded or not, but I can't think of anything for that function to work on character but not on items |