Author Topic: while i work on header, i know i'll be using these subs in some form  (Read 6833 times)

0 Members and 1 Guest are viewing this topic.

Offline roadrunnerTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Activity:
    0%
  • Reputation Power: 2
  • roadrunner has no influence.
  • Gender: Male
  • Respect: +28
  • Referrals: 1
    • View Profile
yes! i will be giving credit to the authors in my header if i do use their work in mine, even in parts not whole. :)

i'm working on a script to make ONE tinker tool, then use it, until it runs out of uses, to make smith hammers 1 at the time. (script makes 1 tinker tool, tinker tool makes 1 smith hammer, hammer makes X amt of shields until hammer expires, then script uses same st tinker tool to make another hammer) just trying to be clear as to how i want it to work. right now script makes a new tinker tool each time it wants a smith hammer. script is as follows.

End of "makes tinker tool" sub
click 28 130 dmc
wait 5
set #contPosX 0
set #contPosY 0
wait 5
click 231 131 dmc
gosub TR_waitfor_generic_gump
return

End of "Makes smith hammer" sub
gosub TR_waitfor_generic_gump
wait 10
finditem %smiths_hammer C_ , #backpackID
wait 5
until #findkind <> -1
return

ok, script makes the  hammer, uses it up, then makes a new tinker tool & then hammer. my question is: can i put this:
wait 10
finditem %tinker_tool C_ , #backpackID
wait 5
until #findkind <> -1
return
at end of tinker tool sub and it work the way i'm asking? thank you all for any advice in advance.

***UPDATE***
i haven't been able to give it an extensive test yet but so far it's made 2 smith hammers withOUT making a new tinker's tool. i also lowered the ingot pull to guarantee character doesn't become 'to encumbered to move!' whilst running script. so far it's running ok. i'll be analyzing farther down now and trying to learn more so i can incorporate it all into my script.
By the way, TM, i AM using scriptUO to view/ analyze scripts now. it really is helpful. sub breakdown, colored fonts, etc., very nice job man!
« Last Edit: May 23, 2013, 03:52:24 AM by roadrunner »

Offline UoLugnutz

  • Full Member
  • ***
  • Posts: 123
  • Activity:
    0%
  • Reputation Power: 2
  • UoLugnutz has no influence.
  • Respect: +25
  • Referrals: 0
    • View Profile
0
Once you start using the ScriptUO program you will never go back! The time it will same in writing/debugging is amazing. Also when posting code look for the hash tag button above the smile faces for inserting code into the message. Just a little easier to read. On quick glance Repeat/Until work hand in hand. If you have one you need the other.

Offline roadrunnerTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Activity:
    0%
  • Reputation Power: 2
  • roadrunner has no influence.
  • Gender: Male
  • Respect: +28
  • Referrals: 1
    • View Profile
0
thank you UOLugnutz! :) i have MUCH to learn but only way i'll get there is to play with some & practice.
i'm real glad someone linked me to the scripter's 'glossary'.now i'm able to look up each command and see exactly what it's doing. not all of it is perfectly clear the 1st time i read but i have learned some things.


i also wanted to post update that the "until #findkind <> -1" has worked like a charm in this instance. i did, however, have to go into the 'open backpack' sub and increase the wait from 10 to 15 because it was going so fast it wasn't seeing the 1 tinker's tool in pack and shutting down the script. now i've got 1 tinker tool that's being used again & again to make smith hammers as needed. only have 1 smith hammer in pack at time now, so it's saving item count space & overall weight.
it's progress, small bits yes, but gotta crawl before i can run
« Last Edit: May 23, 2013, 04:43:37 AM by roadrunner »

Offline Hoby

  • Elite
  • *
  • *
  • Posts: 1344
  • Activity:
    0%
  • Reputation Power: 14
  • Hoby barely matters.Hoby barely matters.
  • Gender: Male
  • Respect: +79
  • Referrals: 1
    • View Profile
0
Quote
scripter's 'glossary'

whoa.....hold on......whats this scriptor glossary you speak of?
I like you, your death shall be quick and painless!!
I may have alzheimers, but at least I don't have alzheimers.
Walruses are like vampires, only awesome
Pwned-The total domination or shut down of a person or thing. 
I believe a hangover is gods way of saying you kicked ass last night!
Life's to short to remove usb safely.

Offline dxrom

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile



 ​_██​_
(ಠ​_ృ)
I do say, ol' Chap! Come play EVE Online! Why here is a 21 Day Free Trial!

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
0
thank you UOLugnutz! :) i have MUCH to learn but only way i'll get there is to play with some & practice.
i'm real glad someone linked me to the scripter's 'glossary'.now i'm able to look up each command and see exactly what it's doing. not all of it is perfectly clear the 1st time i read but i have learned some things.

That scripters "glossary" is also available in ScriptUO.  Just goto Tools/EasyUO Wiki/ and select the command you want help on.  Also, if there's a command you want help on in the editor, just double-click on the command, and right click to bring up the context menu.  Then just select "Get Help for 'xxxxx'"
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline roadrunnerTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Activity:
    0%
  • Reputation Power: 2
  • roadrunner has no influence.
  • Gender: Male
  • Respect: +28
  • Referrals: 1
    • View Profile
0
 ??? ???   TM!!  that just made life soooooo much easier!!  Thank you Sir!! there have been several commands i hadn't been able to locate yet but now i've got them!
now to have some coffee & wake up some, then try to decipher that sub section 1 more day. err, time, lol

Offline Alpha

  • Hero Member
  • *
  • Posts: 583
  • Activity:
    0%
  • Reputation Power: 10
  • Alpha barely matters.Alpha barely matters.
  • Respect: +44
  • Referrals: 0
    • View Profile
0
The Event macro List.. is in the glossary, but I've just had a separate link for it also...

http://wiki.easyuo.com/index.php/Event_Macro#Speech

Offline roadrunnerTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Activity:
    0%
  • Reputation Power: 2
  • roadrunner has no influence.
  • Gender: Male
  • Respect: +28
  • Referrals: 1
    • View Profile
0
thank you Alpha, very much.
i've checked out this sub for handing in the bucklers, and from what i've traced, it all seems fine. i guess it's the part of the script it goes back to when 'return' sends it back, but i'm not skilled enough to figure out where in the script it goes to and figure it out.

i've managed to use the script in a round about way. it makes bucklers, when i see it recall to library i hit pause on EUO. i then let a 2nd macro gather all the bucklers into a bag and i manually donate bag. then i hit play on EUO. script sees bucklers are gone and it recalls home, makes me another 60. i've got it where it takes care of having tinker tool, smith hammer, ingots, and making correct amount of bucklers. i just can't figure out the donation part.

this is why i was hoping somebody with scripting skill would take a look at it because i don't think it would take much to 'fix' it, but i just don't know where in the script to adjust now.
and YES!! if someone would cut/ paste where in the script i need to focus on, i'll damn sure keep trying. i'm just out of ideas now

Offline Alpha

  • Hero Member
  • *
  • Posts: 583
  • Activity:
    0%
  • Reputation Power: 10
  • Alpha barely matters.Alpha barely matters.
  • Respect: +44
  • Referrals: 0
    • View Profile
0
OK a few things...

1) It appears you want help making the script donate the bucklers...  WHERE is the script ??  I looks to me you posted a few pieces of it in your initial post, but we have to see the whole thing to generally be of any use to you.

2)  You may or may not already know this, but the biggest tools for figuring out what's going on in a script are   

F7    (Single step line by line through your script)
& Also under the "Tools" tab at the top of the EUO window  There are the following 2 options...

-VarDump
-Manage VarList

Typically when I'm trouble shooting something I will be going line through the script and then when I get to the part giving me trouble I will use the VarDump command in the tools section of EUO (While your script is paused) and that pops up a window of ALL your variables..   # (pound sign) denotes SYSTEM variables.... aka the stuff in the right side of your EUO window..  while % (Percent sign) are your user created variables....

The Manage VarList option under Tools allows you to CHANGE how that right side panel of EUO appars..   You can literally put any variables you want in there.. so say your script has something like...

set %Name Bob

You could go to the Manage VarList section and add something like

\USER
%Name

and you'd be able to expand the "USER" variable section in the right panel of EUO and see the VALUE of %Name... which should be BOB.. 

3).. Lol..  I don't actually remember how the donation part of something works in game.. so a fairly detailed description is necessary to really have any chance at writing something that will work..   Do you just drop the bag of stuff on an npc?   Is there a context menu involved etc?



Offline roadrunnerTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Activity:
    0%
  • Reputation Power: 2
  • roadrunner has no influence.
  • Gender: Male
  • Respect: +28
  • Referrals: 1
    • View Profile
Re: while i work on header, i know i'll be using these subs in some form
« Reply #10 on: May 24, 2013, 02:46:16 PM »
0
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
« Last Edit: May 24, 2013, 02:59:16 PM by roadrunner »

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13302
  • Activity:
    0.2%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: while i work on header, i know i'll be using these subs in some form
« Reply #11 on: May 24, 2013, 02:59:05 PM »
0
Donation is a bit of a pain in the ass honestly.  The different sized bitmaps causes different alignment in the donation gump.  You need to be able to click the little blue carrot assuming you have the required items.  That's just an x,y offset from the #CONTPOSX, #CONTPOSY of the donation gump.  After that you just "msg (amount)"

I'll attach my UNFINISHED donation subs with hopes they might give you some ideas.

I have no idea if these EVER worked....  I think they did, but the last time I tested them was years ago.  They are definitely incomplete.

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
tm_donate3.txt
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline roadrunnerTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Activity:
    0%
  • Reputation Power: 2
  • roadrunner has no influence.
  • Gender: Male
  • Respect: +28
  • Referrals: 1
    • View Profile
Re: while i work on header, i know i'll be using these subs in some form
« Reply #12 on: May 24, 2013, 07:57:49 PM »
0
Thanks TM !!  i just got home and headed to bed but i'll certainly give tis a look in morning. maybe it'll help me figure Reaper's out.

Offline UoLugnutz

  • Full Member
  • ***
  • Posts: 123
  • Activity:
    0%
  • Reputation Power: 2
  • UoLugnutz has no influence.
  • Respect: +25
  • Referrals: 0
    • View Profile
Re: while i work on header, i know i'll be using these subs in some form
« Reply #13 on: May 25, 2013, 06:11:32 AM »
0
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 #weightSets 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 point
Code: [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 gump
Code: [Select]
gosub TR_waitfor_generic_gumpJust leaves the sub to check that the donation script is opened and returns back when this is true
Code: [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 :) Assuming your click was correct you now need to enter the amount of bucklers with the key board. Now since we are unattended we can not physically type in the amount of bucklers, in this case 50, so the script will mimic this by using the msg command. Since your click is wrong it will just message on screen instead. Now we hit the weight check in the Repeat/Until loop. The Until checks to see if your weight has changed. So it will compare actual weight, #Weight, to the %TR_temp_weight set at the beginning. We used 500 as an example. So the only way the Repeat/Until loop will break if your weight changes less then 500. But if you don't donate anything it will loop forever because your weight won't change less then 500 always spamming the msg command in the loop.
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!





Offline roadrunnerTopic starter

  • Full Member
  • ***
  • Posts: 107
  • Activity:
    0%
  • Reputation Power: 2
  • roadrunner has no influence.
  • Gender: Male
  • Respect: +28
  • Referrals: 1
    • View Profile
Re: while i work on header, i know i'll be using these subs in some form
« Reply #14 on: May 25, 2013, 08:35:23 AM »
0
UOLugNutz you Sir are a Saint in the making! to go thru all of that, in such detail, is truly worthy of much praise! you've been helping me along & along and i truly do appreciate every last bit!!
here's where the real testament to your help comes in. i honestly, no questions, understood all of that quite easily, right down to the x/y =0/0 then click. :)

now, for some feedback for you. i had adjusted the click coords and when the character got the gump open i saw "50" appear to the right of 'buckler' on the gump ITSELF, not in mid-air as player 'speech'. being there were 50 odd bucklers scattered around the backpack i didn't notice one suddenly missing and like an idiot, assumed it was still incorrectly trying to donate them & i stopped it.  i'm going to re-calibrate the blue dot coords to be 100% sure of the location, but in my notes i've got 37 270, so yes Sir, your 'guess' is pretty darn close!

i'll give this a test & post the results in a little while.
Thank you UOLugNutz, Trailmyx, Alpha, Bookwyrm, Manwinc, Nobama, and anyone else that offered advice on this issue!!

God willing, my next post will be 'No issues to report!' :)

Tags: