Turley wrote:Poi wrote:
Code: Select all
stack := CreateItemInContainer( bankbox, 0xEED, amount );
"stack" is a reserved operand. You have to use a different variablename.
Thank you...
New issues now
First let me post my scripts:
Create check script(I haven't added it to the bank vendor yet, just a simple text command)
Code: Select all
use os;
use uo;
include "util/bank";
program textcmd_createcheck( who, text )
var bankbox := FindBankBox( who );
if (!text)
SendSysMessage(who, "You can't write a blank check, silly.");
return 0;
endif
var amt1 := 0;
foreach item in EnumerateItemsInContainer( bankbox )
if(item.objtype == 0xeed)
amt1 := (amt1 + item.amount);
endif
endforeach
if (text > amt1)
SendSysMessage(who, "Silly, you don't have that many gold coins!");
return 0;
endif
var check := CreateItemInBackpack( who, 0x5abd );
var madecheck := SetObjProperty(check, "amt", text);
if (madecheck)
SetName(check, "a bank check for " + text + " gold coins");
else
destroyitem(check);
SendSysMessage(who, "Your hand is shaking to much to right the check.");
endif
endprogram
I haven't gotten to do the destroy gold in bank part yet, but this is just for reference with my new problem, read on
This is the script that runs when the check is double clicked..
Well, now when I double click the check it tells me
"That check is blank, there isn't to much you can do with it"
Which tells me that the worth variable is either less then or equal to 0...
And the worth variable is the get prop for "amt"(the amount on the check)
And just to clear something up, when it tells me "That check is blank, there isn't to much you can do with it" that is the second if, meaning worth <= 0, rather then (!worth)
(read the script a bit, you will understand)
Code: Select all
use os;
use uo;
include "util/bank";
program bankcheck(who, deed)
var maxamt := 60000; //Don't touch this line!(unless lowering it below 60k, as 60k is the stackable limit.)
var namt := 0;
var worth := GetObjProperty(deed, "amt");
if (!worth)
SendSysMessage(who, "That check is blank, there isn't much you can do with it");
return;
endif
if (worth <= 0)
SendSysMessage(who, "That check is blank, there isn't to much you can do with it");
return;
endif
var bankbox := FindBankBox( who );
if ( bankbox != deed.Container )
SendSysMessage(who, "The deed must be in your bank.");
return;
endif
var amount := 0;
var stackg := 0;
while(worth > 0)
if (worth >= maxamt)
amount := maxamt;
endif
if (worth < maxamt && worth > 0)
amount := worth;
endif
stackg := CreateItemInContainer( bankbox, 0xEED, amount );
if (stackg)
namt := worth - amount;
SetObjProperty(deed, "amt", namt);
worth := GetObjProperty(deed, "amt");
endif
if (worth <= 0)
destroyitem(deed);
endif
endwhile
endprogram
Just want to say thanks to all of you, and your help
