SphereCommunity
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)

Pages: 1 2 3 4


Gold -> Bag -> Bank - Llirik - 08-13-2015 06:16 PM

Who wan't me help to put gold in bag and bank. Sorry my English is not good:

[FUNCTION PAYPALL]
PayPallFunc <ARGS>

[FUNCTION PayPallFunc]
VAR.COUNTER=<EVAL <ARGS>>
IF (<VAR.COUNTER> > 65000)
serv.newitem i_gold, 65000, i_bag
new.cont <src.findlayer.29.uid>
VAR.COUNTER=(<VAR.COUNTER> - 65000)
PayPallFunc <VAR.COUNTER>
ELSE
serv.newitem i_gold, <ARGS>, i_bag
new.cont <src.findlayer.29.uid>
ENDIF


RE: Gold -> Bag -> Bank - evening - 08-13-2015 07:10 PM

i don't know if you need is this?

[function paypallfunc]
var.counter=<eval <args>>
serv.newitem=i_bag
new.cont=<src.findlayer.29.uid>
local.baguid=<new>
if (<args> > 65000)
serv.newitem i_gold, 65000
new.cont <local.baguid>
var.counter=(<var.counter> - 65000)
paypallfunc <var.counter>
else
serv.newitem i_gold, <args>
new.cont <local.baguid>
endif

use
.paypallfunc 65000


RE: Gold -> Bag -> Bank - Kanibal - 08-14-2015 01:26 AM

Code:
[FUNCTION f_add_gold]
serv.newitem i_bag, 1, <src.findlayer.29.uid>
var.newbag = <new.uid>

if (<argn1> > 65000)
  var.tmp=<argn1>/65000
    for i 1 <var.tmp>
      serv.newitem i_gold, 65000, <var.newbag>
    endfor
    serv.newitem i_gold, (<argn1>-(<var.tmp>*65000)), <var.newbag>
else
   serv.newitem i_gold, <argn1>, <var.newbag>
endif
src.update
use
.f_add_gold 1000000


RE: Gold -> Bag -> Bank - XuN - 08-14-2015 02:48 AM

Or you can simply: GOLD += 5000, this will add 5000 gold to your bank. Note that you have to use += to add gold, using GOLD=5000 will remove all your gold and add 5000gp to your bank so be carefull about using = or +=. <gold> will also retrieve the total gold that you own.


RE: Gold -> Bag -> Bank - Coruja - 08-14-2015 03:00 AM

you can use the internal function NEWGOLD <value> to create the gold on the bankbox

or if you want add the gold on other location (like backpack), you must use a new function like this
Code:
[FUNCTION PayPallFunc]
WHILE (<ARGS> > 0)
  SERV.NEWITEM i_gold
  IF (<ARGS> > <SERV.ItemsMaxAmount>)
    NEW.AMOUNT=<SERV.ItemsMaxAmount>
  ELSE
    NEW.AMOUNT=<ARGS>
  ENDIF
  NEW.CONT=<FINDLAYER.layer_backpack.UID>
  ARGS -= <NEW.AMOUNT>
ENDWHILE



RE: Gold -> Bag -> Bank - evening - 08-14-2015 03:36 AM

(08-14-2015 01:26 AM)Kanibal Wrote:  
Code:
[FUNCTION f_add_gold]
serv.newitem i_bag, 1, <src.findlayer.29.uid>
var.newbag = <new.uid>

if (<argn1> > 65000)
  var.tmp=<argn1>/65000
    for i 1 <var.tmp>
      serv.newitem i_gold, 65000, <var.newbag>
    endfor
    serv.newitem i_gold, (<argn1>-(<var.tmp>*65000)), <var.newbag>
else
   serv.newitem i_gold, <argn1>, <var.newbag>
endif
src.update
use
.f_add_gold 1000000

such calculations are not accurate

your use .f_add_gold 251110
look it is a reference
[FUNCTION CreateGold]
IF (<ARGN>)
VAR.Created="<ARGN>"
WHILE (<VAR0.Created> > 0)
NEWITEM=i_gold
IF (<VAR0.Created> > 65535)
ACT.AMOUNT=65535
VAR.Created="<EVAL <VAR0.Created>+ -65535>"
ELSE
ACT.AMOUNT=<VAR0.Created>
VAR.Created=
ENDIF
ACT.CONT=<FINDLAYER.21.UID>
ENDWHILE
RETURN 1
ENDIF
RETURN 0


RE: Gold -> Bag -> Bank - Kanibal - 08-14-2015 04:31 AM

(08-14-2015 03:36 AM)evening Wrote:  such calculations are not accurate
Lol


RE: Gold -> Bag -> Bank - evening - 08-14-2015 05:15 AM

(08-14-2015 04:31 AM)Kanibal Wrote:  
(08-14-2015 03:36 AM)evening Wrote:  such calculations are not accurate
Lol
maybe after we test, provide an answer to the questioner will be better!


RE: Gold -> Bag -> Bank - Llirik - 08-14-2015 09:09 PM

Thank you!


RE: Gold -> Bag -> Bank - Kanibal - 08-18-2015 04:42 AM

(08-14-2015 05:15 AM)evening Wrote:  maybe after we test, provide an answer to the questioner will be better!
Ok Veryhappy
Code:
[FUNCTION f_add_gold]
serv.newitem i_bag, 1, <src.findlayer.29.uid>
var.newbag = <new.uid>
var.money = <argn>
  
if <var.money> > 65000
  while <var.money> > 65000
    serv.newitem i_gold, 65000, <var.newbag>
    var.money = <var.money> - 65000
  endwhile
  serv.newitem i_gold, <var.money>, <var.newbag>
else
  serv.newitem i_gold, <var.money>, <var.newbag>
endif
src.update