1
Script Debug / Re: while i work on header, i know i'll be using these subs in some form
« on: May 25, 2013, 06:11:32 AM »Alpha, the script i'm 'trying' to fix for my own use is in 'Submit Your Script' section of this site (here's the URL: http://www.scriptuo.com/index.php?topic=7750.0 The Reaper's Mace and Shield Donator
i am very very very INexperienced at using scripts, much less writing them, but i've taken courses in HTML and web design a long long time ago and decided i'd give this a try because i REALLY want this script to work.
when i 1st loaded this Donator, the crafting gumps were so fkd up due to OSI changes over the years, it was making baskets, axes, and making them by the truck loads! LOL. friend of mine & i got it sorted out to doing all the right things now Except the actual donation. it opens the NPC's gump and starts yelling "50" over & over. (script makes 50 bucklers per trip) but for life of me i cannot find where the speech part is at, i don't see it in the 'hands in the bucklers' sub routine and i've been trying to go thru the script line by line but today has been a busy day in real and i'm about to go out to dinner w/ the girlfriend. i welcome and truly appreciate all advice & help!!!
i'll be working on this tomorrow (Saturday) over coffee. if anyone leaves me any things to try, that's when i'll be testing them. i'm East coast U.S. & i usually am online 630-7am 7 days a week. (i'm retired)
Library donation: double click NPC, donation gump opens, beside items your character has that are accepted will be a blue gem 'button' on left side of item name, click the button of your item, target item in your main pack. then you can repeat the button/ target until all are donated(which is how i "THINK" Reaper originally wrote the script to work, based on it monitoring character weight decreasing) a bag of items can be donated but you keep the bag and there is a 2nd 'donate all' button to click on 2nd gump if using bag of items
Reading the post your problem is simply the click location of the little blue gem is wrong. When that is fixed the donation should work fine. Below is the donation sub from the script
Code: [Select]
;==================================
; Hands in the bucklers
sub TR_Hand_in
set %TR_temp_weight #weight
repeat
set #lobjectID %TR_Donation_NPC
event macro 17 0
gosub TR_waitfor_generic_gump
set #contPosX 0
set #contPosY 0
wait 5
click 40 260 dmc
wait 10
msg %TR_no_bucklers $
wait 10
until #weight < %TR_temp_weight
set %TR_Status_bucklers ( %TR_Status_bucklers + %TR_no_bucklers )
set %TR_no_bucklers 0
gosub TR_update_status
return
Now in your post you describe how you think the donation sub works which is not quite right. Let me try and explain.
Code: [Select]
set %TR_temp_weight #weight
Sets a variable to the amount of the system variable your weight. Lets say 500 for now. So both %TR_temp_weight and #weight will equal the same at this pointCode: [Select]
set #lobjectID %TR_Donation_NPC
event macro 17 0
Sets the #lobjectID from the variable %TR_Donation_NPC which is the NPC you picked at the start up of the script to donate the bucklers to and then event macro 17 (use last object) mimics the double click of the NPC to open the donation gumpCode: [Select]
gosub TR_waitfor_generic_gump
Just leaves the sub to check that the donation script is opened and returns back when this is trueCode: [Select]
set #contPosX 0
set #contPosY 0
wait 5
click 40 260 dmc
wait 10
Now comes the root of all evil where I think you are getting messed up. Using the system variable #ContPosX and #ContPosY the script will move the donation gump to the co ords 0/0. Which is the top most left corner. Then it will use the click command to press the little blue gem. The numbers 40 260 are wrong as the location has changed. Now let me ask this. When you try and determine what the correct location of the click is are you moving the donation gump to same #ContPosX and #ContPosY as the script does? Remember the script will move the gump then click. So you need to move the gump then check what the correct click position is. I'm thinking the 260 should be 270 or 280. But that's just a guess.Code: [Select]
msg %TR_no_bucklers $
wait 10
until #weight < %TR_temp_weight
Now here comes your loop of death 
The rest of the sub just updates some numbers and that's it. Fix the correct click and you will be in a state of total bliss

Hope this helps!