ScriptUO

Official ScriptUO EasyUO Scripts => Submit your Script => Topic started by: Crisis on January 03, 2014, 03:30:34 PM

Title: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 03, 2014, 03:30:34 PM
Code: [Select]
;===================================================================
;===================================================================
; Script Name: Crisis Carpentry Trainer
; Author: Crisis
; Version: 1.0
; Client Tested with: 7.0.34.6
; EUO version tested with: 1.5 (version 247)
; Shard OSI / FS: FS (runuo Version 2.2, Build 4925.27724)
; Release Date: 01/03/2013
; Revision Date: N/A
; Purpose:
;     .Train Carpentry 0-100
;
; Revisions:
;     . N/A
;
; Requirements:
;     . Make sure that you do not have colored ingots in your secure, keep only iron ingots in your secure.
;     . You need to have a secure resouce bag and an axe.
;     . You must have at least one tinker tool in your backpack.
;     . You must have enough tinkering to craft tinker tools and fletcher tools
;     . If you are using the bank, you must be at the bank and say "bank" before starting the script. I will adjust the script to include this in a future update.
;
; Future Updates:
;     . Suggest some :)
;
; Special Thanks:
;     . Ximan for helping me work out some of the bugs.
;
; Copyright: 2014 Crisis
;===================================================================
;===================================================================

(http://thedemigod.com/pics/carpmenu.jpg)

Okay I have tried this and it seems to be working well but I would love for some people to test it out.

If anyone plays runuo and wants to help, I could use the offset click numbers for the different items to craft. As of right now, this has been tested on OSI only.

Let me know what you think and any suggestions that you may have. Thanks!

I am still working on the timing issues with crafting new tools and moving boards. Try V1.5
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: The Ghost on January 04, 2014, 07:54:03 AM
hi Crisis
Test run:
Here what I have so far.

1) Menu need to be move to the side, so your Message box can be seen.  
    update,  after I restarted it was out to the side .

2) Need to add WMF(Medium crate  facing East),   to you breakgarbage.    It wasn't able to get the crate while at 37 skill.
      With this added, everything find.

10k board in secure let see what that will do.  

3) Only have 30 thinker so, it easier to make Wooden Items,  I change the saw to Joinging Plane.
Code: [Select]
gosub offsetclick 27 110 ; Wooden Items  27 130  ; tools
and
 gosub offsetclick 235 90 ; Jointing Plane 235 210   ; saw

4)  why the trash barrel?  are we suppose to break down all the items.

5) It raise skill fast and it elegant as well,  I like it.  
 let add 10k board and see where we go.  at 49.9 Now.

6)  just find out that we can't be away from screen,  my thinkering menu fail and have to opening my hand.  :((  so I add to make more  Carpentry tools too

Code: [Select]
sub MakeCarpTools
menu delete scriptstatus
Menu Font BGColor Black
menu Font Color Lime
menu text scriptstatus 95 100 Getting New Carpenter's Tool
  finditem %boards C_ , #BackpackID
  if #findstack >= 50
    goto _makecarptool
  set %_diff 50 - #findstack
  finditem %boards C_ , %ResourceSecure
  if #findstack < 50
  {
    display You have used up most of your ingots. Halting...
    set *request END
    return
  }
  gosub moveit #backpackid %ResourceSecure #findid %_diff

  _makecarptool:
  finditem %tinkertool C_ , #Backpackid
  if #findcnt = 0
  {
    display You are out of tinker tools. Get a tinker tool and restart script.
    set *request END
    halt
  }
  set #lobjectID #Findid
  gosub actionblock
  event macro 17 0
  gosub tinkwait
  gosub offsetclick 27 110 ; Wooden Items  27 130  ; tools
  wait 5
  gosub tinkwait
  gosub offsetclick 235 90 ; Jointing Plane 235 210   ; saw
  wait %postcraftwait
  makelast:
  gosub tinkwait
  gosub offsetclick 280 450   ; make last
  wait %postcraftwait
  finditem %carptool C_ , #Backpackid
  if #findcnt < 8
  goto makelast
  gosub tinkwait
  gosub offsetclick 30 450  ; exit
  wait 10
return
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 04, 2014, 10:16:51 AM
1. For me when I first run the script, it opens it at the top, middle of my screen and I have a 23 inch monitor. What size monitor do you have? I will look into moving it for a smaller monitor.

2. I changed it to WMF, not sure what happened there, Thanks for catching it!

3. I made the change to the jointing plane, did not realize they were easier to make at lower skills.

4. I had it in there because I had the script dump all if the crafted things in the trash barrel on start up while I was working on the breakstuff sub. In the final version I will remove the trash can and all references to it.  ;D

5. I am glad it is running quick for you, I was hoping it would be quick for others too.

6. I am uploading the changed one. Try it again, I noticed that last night and changed the timing a little bit. I ended the night running 3 hours, gaining 20.1 points on 5119 attempts to GM Carpentry.


Thanks for letting me know how it has worked so far. Please try running it again and let me know how these changes help.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: 12TimesOver on January 04, 2014, 11:03:37 AM
Funny timing, I decided this morning to train up carpentry so I can make some suits. I was going to write my own but decided I'd go ahead and test for ya.

Just a couple things I've run into so far-

1) The first thing I did was to get rid of all the opening of my journal, pack, skills, etc in the Setup sub. Not sure why you go through all of that but I always find it annoying when a script moves all my stuff around and I couldn't figure out a reason for it :) That could just be a XIIx-ism though.
2) It pulled Shadow Iron ingots out of my secure instead of regular ingots. I paused and moved some Iron into my pack so I could keep testing, it was able to keep going but it did pull more shadow ingots out since it had already set the %ingots to my stack of Shadow. You should either add some color checking when setting the %ingots var or just make it clear in your instructions that only Iron ingots should be in your secure.
3) After this it made a box, axed it, then made 9 Moulding Planes before I hit stop.

Keep it coming!!

X
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 04, 2014, 01:02:50 PM
Funny timing, I decided this morning to train up carpentry so I can make some suits. I was going to write my own but decided I'd go ahead and test for ya.

Just a couple things I've run into so far-

1) The first thing I did was to get rid of all the opening of my journal, pack, skills, etc in the Setup sub. Not sure why you go through all of that but I always find it annoying when a script moves all my stuff around and I couldn't figure out a reason for it :) That could just be a XIIx-ism though.
2) It pulled Shadow Iron ingots out of my secure instead of regular ingots. I paused and moved some Iron into my pack so I could keep testing, it was able to keep going but it did pull more shadow ingots out since it had already set the %ingots to my stack of Shadow. You should either add some color checking when setting the %ingots var or just make it clear in your instructions that only Iron ingots should be in your secure.
3) After this it made a box, axed it, then made 9 Moulding Planes before I hit stop.

Keep it coming!!

X

Thanks for the input!

1. I guess the skills and journal is me being lazy and liking them in a specific place. I can remove that part and have my own copy with it in there.  ;D

2. Checking for colored resources is not something that I have messed with yet. I will put it in the script to have only iron ingots in the secure for now and look at learning the other later. Once I am good with it, I can add the check into the script.

3. I am not sure about it making 9 jointer planes. I had a problem with that a while ago and thought that I had it fixed. Do you happen to see a mistake that would cause it to happen? I tested it last night for a little over 3 hours and it ran smoothly making only 2 at a time. Could it be a timing issue?


I am currently working on a WoodWorker Deluxe which will include Carpentry, Bowcrafting, and Tinker trainers, craft arrows & bolts, craft fukiya darts, poison fukiya darts (for oracle), and craft logs into boards. This is a huge undertaking for me since I am learning but as of right now, I have the 3 trainers into one script and working. I love scripting even though it can get frustrating when you cannot find that one typo or wrong word that is messing everything up. I hope to start doing more advanced stuff in the near future.  8)
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: The Ghost on January 04, 2014, 01:17:36 PM
Ver 1.1 is up and running. 

 Not that is your fault,   I'm having this issue from time to time
 at line 542
Code: [Select]
gosub moveit #backpackid %ResourceSecure %boards 200
 event macro 8 7 ; open pack  to remove ghosting
 gosub hardwait %postregmovewait


OK  I really need to fix that tinkering gump.    I stop there every time  the wait is wrong for me.    I even at line 429
set %gumpwait 1 0

Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 04, 2014, 01:19:46 PM
1.2 is up and I left 1.1 up for now as well.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 04, 2014, 01:53:48 PM
Ver 1.1 is up and running. 

 Not that is your fault,   I'm having this issue from time to time
 at line 542
Code: [Select]
gosub moveit #backpackid %ResourceSecure %boards 200
 event macro 8 7 ; open pack  to remove ghosting
 gosub hardwait %postregmovewait


OK  I really need to fix that tinkering gump.    I stop there every time  the wait is wrong for me.    I even at line 429
set %gumpwait 1 0



I have a really fast internet connection so it is harder for me to work with timing plus I am still learning. If you look in the constants section you will see some timing tweaks that you can make.

Code: [Select]
; Timing tweaks.  20 = 1 second
  set %gumpwait 1          ; Time to wait before scanning for open gump/container
  set %gumptimeout 60      ; Maximum amount of time to wait for gump to open

  set %precontposwait 10   ; Time to wait after opening gump and moving it using contpos
  set %postcontposwait 30  ; Time to wait after performing contpos

  set %postdropwait 22     ; Time to wait after each exevent drop before attempting any other action
  set %postcraftwait 1     ; Time to wait after an item is crafted before performing any other action

  set %preregmovewait 10   ; Minimum time to wait before moving all regs
  set %postregmovewait 22  ; Extra time to wait after moving all regs, (in addition to %postdropwait, above)

  set %interactiontime 10   ; Minimum measured interval between all { exevent drop, event macro } operations


  set %_lit %interactiontime * 20
  set %_lastactiont #systime - %_lit

Hopefully this will help you with the waits. You can also adjust the gumpwait, tinktwait, and carptoolwait

Code: [Select]
sub GumpWait
  set %_tm #systime + ( %gumptimeout * 30 )
  gosub hardwait %gumpwait
  while #contsize <> %cwin
  {
    sleep 10
    if #systime > %_tm
    {
      display Problem waiting on craft gump, open manually then press play easyuo menu
      pause
    }
  }
return #true

;===================================================================

sub carptoolwait
  set %_t #systime
  set %_tm #systime + ( %gumptimeout * 30 )
  gosub hardwait %gumpwait
  while #contsize <> %cwin
  {
    sleep 10
    if #jindex >= %ji
    {
      for %_a %ji #jindex
      {
        scanjournal %_a
        if worn_out in #journal
        {
          return getcarptool
        }
        set %ji %ji + 1
      }
    }
    if #systime > %_tm
    {
      return false
    }
  }
  set %_t #systime - %_t
return true

;===================================================================

sub tinkwait
  set %_tm #systime + ( %gumptimeout * 30 )
  gosub hardwait %gumpwait
  while #contsize <> %tinkwin
  {
    sleep 10
    if #systime > %_tm
    {
      display Problem waiting on tinkering gump, open manually then press play on easyuo menu
      pause
    }
  }
return  #true

I really appreciate your input and hope this helps!
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: 12TimesOver on January 04, 2014, 02:35:53 PM
Yeah the moving stuff around is definitely a personal preference but if you are submitting a script for other people to use you just need to think about stuff like that since everybody has a different setup than you.

I have no idea on the planes, I didn't have a chance to look into things further just because I had to make dinner (made sushi tonight, SUH-WEET!).

Anyway, I'll play around more later.

X
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: The Ghost on January 04, 2014, 04:24:38 PM

I have fast connection too,  going to blame my switch.  My Mule laptop  go through a switch. 

I beleive I fix the tinkering issue.
Code: [Select]
sub tinkwait
  set %_tm #systime + ( %gumptimeout * 40 )  30 to quick I need 40
  gosub hardwait %gumpwait
  while #contsize <> %tinkwin
  {
    sleep 10
    if #systime > %_tm
    {
      display Problem waiting on tinkering gump, open manually then press play on easyuo menu
      pause
    }
  }
return  #true
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 04, 2014, 04:51:26 PM
Let me know how it goes from here on out.

1. Were you able to go away from the screen while it ran?

2. Did you have the same issue as 12X with it making the jointing planes over and over?

Thanks for the input!
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: The Ghost on January 04, 2014, 05:39:37 PM
Every time I move away from Monitor it stop.   NO bad I don't need a third carpenter.   Just burning wood for you. :)  

Ok here some more change. those should help 12TimesOver, since your version wasn't updated properly.  

sub MakeTinkerTools
it should be (line 590)
Code: [Select]
gosub offsetclick 27 130  ; tools
sub MakeCarpTools
Code: [Select]
finditem %ingots C_ , #BackpackID
       need to be replace by
finditem %boards C_ , #BackpackID

and to remove the ghosting  I change your wait 5 to 10.  
Code: [Select]
gosub offsetclick 27 110  ; Wooden Items
  wait 10
  gosub tinkwait
  gosub offsetclick 235 90   ; jointing Plane

update
Now I'm ghosting tnker tool like a MOFO  :)  
Tinkering been the pain of my excitement since I hit play. 
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 04, 2014, 07:52:46 PM
1.3 is up, I made those adjustments. I am not sure about the ghosting, I just ran it for 90 minutes with no issues.  :-[
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: gimlet on January 05, 2014, 07:21:03 AM
Testing Now - had to add my axe type

FSF (hatchet)

more latter
Thanks
Gim
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 05, 2014, 07:31:51 AM
I added in FSF tot he axe types and put 1.3 back up. I don't think it will matter because I had changed it so that the script targets the axe but I could be wrong. There is so much to learn lol.

I really appreciate all of you testing it for me and helping me find things that I missed!
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: The Ghost on January 05, 2014, 09:26:13 AM
Loaded 1.3.
 Still ghosting the backpack with tinker and carpentry tool.   The crafting part work 100%    I will have to see how to slow it down a bit on those two sub.   Still can't walk away from it :(
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: gimlet on January 05, 2014, 09:35:11 AM
Everything seems to work well except for the tink menu popping up. Then I get the message to open tink gump and press play.

So at the moment I am just loading my backpack with planes.

I was going to just add a sub to do what your message asks to do but ill wait for next version.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: 12TimesOver on January 05, 2014, 11:39:23 AM
Running the newest update.

So far not too shabby, 157 gains in about 40 minutes although it kept looping through the move board and craft process after I ran out of boards, didn't notice for 15 minutes or so. For this you could just add a couple of lines when it does a finditem for the boards in the resource container when needing to move more over and if #findkind = -1 there are none left and the script should pause or just halt.

X
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 05, 2014, 11:59:16 AM
Okay, try V1.4. I added in some extra wait times and adjusted the tool waits. See if this works any better for you. Ghost please let me know if it fixes your issues. I appreciate you making a carpenter just to test this!
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: 12TimesOver on January 05, 2014, 02:07:48 PM
Everything seems to work well except for the tink menu popping up. Then I get the message to open tink gump and press play.
This. Big issue, happens a lot. Instead of pausing the script you should just retry using the tinker tool again.

X
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 05, 2014, 02:27:21 PM
Everything seems to work well except for the tink menu popping up. Then I get the message to open tink gump and press play.
This. Big issue, happens a lot. Instead of pausing the script you should just retry using the tinker tool again.

X

I made a change but as I looked at it closer I saw that it wasn't right. Is it happening when making more carp tools or more tinker tools? I need to know that before I make any changes. The tinkwait and carpwait subs both have a gump wait in it and the gumpwait sub is where the message is coming from. I am not sure how I can edit the gumpwait without it clicking the wrong tool. I will need to look at the carpwait or the tinkwait but need to know which is causing it to pop up.

Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: 12TimesOver on January 05, 2014, 06:06:47 PM
Carpentry tools.

Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: gimlet on January 05, 2014, 06:09:13 PM
Carp
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 05, 2014, 06:44:23 PM
If this doesn't do it, I am totally stumped on it. It is not happening to me and I am running Neo's termur LJ and then my carp trainer while surfing the web. I am on my 3rd carpenter testing this out. Hopefully this will do it or someone can look at the code and point me in the right direction. I will be posting 1.5 for you to test.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: 12TimesOver on January 06, 2014, 05:16:38 AM
I started looking at your code but didn't have time to follow everything through last night, had some other stuff going on and you use A LOT of subs in your code :) which makes it a little bit more of a chore. I'll take a look with you sometime today though.

X
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: 12TimesOver on January 06, 2014, 07:08:20 AM
Ok, follow-up...

first, be careful about leaving ID's specific to your environment in the scripts. Just good practice to not link anything script-related to your UO account:
Code: [Select]
; manually set secure cotainer ID's, or leave blank (or N/A) for automated setup
set %ResourceSecure NACAPQD
set %axechopper BNRECOD

Next on the issue of discussion :)

This is the sub:
Code: [Select]
sub GumpWait
  set %_tm #systime + ( %gumptimeout * 60 )
  gosub hardwait %gumpwait
  while #contsize <> %cwin
  {
    sleep 10
    if #systime > %_tm
    {
      display Problem waiting on craft gump, open manually then press play easyuo menu
      pause
    }
  }
return #true

This sub is using the variables from your Constants sub:
Code: [Select]
  set %cwin 530_497 ; 530_437        ; Carpentry window size
  set %gumpwait 1          ; Time to wait before scanning for open gump/container
  set %gumptimeout 60      ; Maximum amount of time to wait for gump to open

so you're sub is doing:
Code: [Select]
sub GumpWait
  set %_tm #systime + 360 ;i.e. systime plus 360ms or just over 1/3 of a second
  gosub hardwait 1 ; based on your hardwait sub this makes the script sleep for 1 milisecond, not sure the point
  while #contsize <> 530_497 ; i.e. if the gump hasn't come up after 1 ms (which it will likely never do for most of us)
  {
    sleep 10 ;again, what is ths point here?
    if #systime > %_tm ;at this point we are saying if more than 371ms has gone buy (less than a half second)
    {
      display Problem waiting on craft gump, open manually then press play easyuo menu
      pause
    }
  }
return #true
So based on the above breakdown you are definitely not giving enough time, or enough variability, in your waits for the average Joe User. The above wait approach can work , as you are seeing for yourself, but it's very complicated and not easily transported from situation to situation.

Here is an example of my Gumpwait standard sub. Not a work of art by any means, I'm certainly a sub-par script writer, but this is pretty simple:

Code: [Select]
;#######################
;SUB XIIxGumpWait
;#######################
; %1 = Required: Gumpname 1
; %2 = Required only if using Gumpsize: Gumpname 2
; %3 = Optional: Gumpsize
; Returns #TRUE if gump occured before timeout, #FALSE if timeout occured
sub XIIxGumpWait
   namespace push
   namespace local nsXIIxGumpWait
   set !gName1 %1
   set !gName2 %2
   set !gSize %3
   set !_time #SCNT
   while #SCNT <= !_time + 5
      {
      if %0 > 2
         {
         if ( #CONTNAME = !gName1 && #CONTSIZE = !gSize ) || ( #CONTNAME = !gName2 && #CONTSIZE = !gSize )
            {
            namespace clear
            namespace pop
            return #TRUE
            }
         }
      else
         {
         if #CONTNAME = !gName1 || #CONTNAME = !gName2
            {
            namespace clear
            namespace pop
            return #TRUE
            }
         }
      }
   namespace clear
   namespace pop
return #FALSE
I use this standard sub for ALL gump waits and timing in any script I write. I got the idea of adding two possible gump names from TM's Gumpwait but I've actually never used it hehe. But notice that in this sub I'm simply saying "keep checking for a matching gumpname and or gumpname/gumpsize combination for 5 seconds and if it comes up, exit and return #TRUE, if not return #FALSE. Simple. No need for "hardwait", "gumpwait", "contIDwait", "carptoolwait", "tinkwait", etc, etc.

Hopefully this helps.

X
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: gimlet on January 06, 2014, 07:33:27 AM
Also I don't know the implication of a missing } (unmatched after the else) but you probably need to check this

Code: [Select]
sub constants

  if %runuo
  {
    set %cwin 530_437      ; Carpentry window size
    set %tinkwin 530_437   ; Tinkering window size

    set %in ItemRUO
  }
  else
  {
    ; EA OSI
  set %cwin 530_497 ; 530_437        ; Carpentry window size
  set %tinkwin 530_497 ; 530_437     ; Tinkering window size

  set %carpentry carp

 ; Materials
  set %ingots ENK
  set %boards TLK
  set %tinkertool JTL_GTL_KTL
  set %carptool YFG_ZHG_CIG_BIG_AGG_EGG_AIG_WFG_IGG_KGG_ZFG_CGG
  set %axeType LSF_OSF_NSF_BSF_MSF_CSF_ISF_MPH_JOH_UOH_RMH_LPH_ZRF_FSF
  set %garbage BTL_OJL_OIK_MDP_ZPF_DMH_GFF_BFR_RPF_VMF_WMF_UMF
  set %breakgarbage VMF_WMF_UMF_BTL_OJL_OIK_MDP_ZPF_DMH_GFF_BFR_RPF

  ; Items to make
  set %Item1 BTL ; Barrel Staves
  set %Item2 OJL ; Barrel Lid
  set %Item3 WMF ; Medium Crate
  set %Item4 UMF ; Large Crate
  set %Item5 OIK ; Wooden Shield
  set %Item6 MDP ; Fukiya
  set %Item7 ZPF ; Quarter Staff
  set %Item8 DMH ; Sheppard's Crook
  set %Item9 GFF ; Black Staff
  set %Item10 BFR ; Wild Staff

  ; max skill threshold for each item
  set %Threshold1 200
  set %Threshold2 320
  set %Threshold3 480
  set %Threshold4 530
  set %Threshold5 600
  set %Threshold6 740
  set %Threshold7 790
  set %Threshold8 820
  set %Threshold9 960
  set %Threshold10 1000

  ; CRAFT substates
  set %s0 CheckTinkerTools
  set %s1 CheckCarpTools
  set %s2 CheckBoards
  set %s3 SkillCraft
  set %s4 DumpGarbage

  ; Timing tweaks.  20 = 1 second
  set %gumpwait 1          ; Time to wait before scanning for open gump/container
  set %gumptimeout 60      ; Maximum amount of time to wait for gump to open

  set %precontposwait 10   ; Time to wait after opening gump and moving it using contpos
  set %postcontposwait 30  ; Time to wait after performing contpos

  set %postdropwait 22     ; Time to wait after each exevent drop before attempting any other action
  set %postcraftwait 1     ; Time to wait after an item is crafted before performing any other action

  set %preregmovewait 10   ; Minimum time to wait before moving all regs
  set %postregmovewait 22  ; Extra time to wait after moving all regs, (in addition to %postdropwait, above)

  set %interactiontime 10   ; Minimum measured interval between all { exevent drop, event macro } operations


  set %_lit %interactiontime * 20
  set %_lastactiont #systime - %_lit

  ; initial states
  set %initialized #false
  set *substate 0
  set *state IDLE
  set *request IDLE
return
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: ximan on January 06, 2014, 11:19:03 AM
Also I don't know the implication of a missing } (unmatched after the else) but you probably need to check this [ code ]

You're right gimlet, needs a closing brace, something got dropped since I posted on euo thread:

Code: [Select]
sub constants

  if %runuo
  {
    set %cwin 530_437      ; Carpentry window size
    set %tinkwin 530_437   ; Tinkering window size

    set %texitx 30
    set %texity 410
    set %tmlx 280
    set %tmly 410
    set %ttoolsx 30
    set %ttoolsy 110
    set %ttinkx 230
    set %ttinky 130
    set %tsawx 230
    set %tsawy 210
   
    set %cexitx 30
    set %cexity 410
    set %cmlx 280
    set %cmly 410
   
    set %in ItemRUO
  }
  else
  {
    ; EA OSI
    set %cwin 530_497      ; Carpentry window size
    set %tinkwin 530_497   ; Tinkering window size

    set %texitx 27
    set %texity 450
    set %tmlx
    set %tmly

    set %ttoolsx 30
    set %ttoolsy 110
    set %ttinkx
    set %ttinky
    set %tsawx
    set %tsawy
   
    set %cexitx 30
    set %cexity 410
    set %cmlx
    set %cmly
   
    set %in Item
  }
 
  ; initial board check, otherwise set in Item subs
  set %CraftingBoards 5

; ...

Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 06, 2014, 12:19:54 PM
Also I don't know the implication of a missing } (unmatched after the else) but you probably need to check this [ code ]

You're right gimlet, needs a closing brace, something got dropped since I posted on euo thread:

I didn't end up using those from the euo board. I had found the mistake and didn't use those changes though I had left the very beginning of the runuo portion in there to remind me to see if someone could give me the offset clicks for runuo. When you posted that comparison website, I found the mistake that I had made.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 06, 2014, 12:43:28 PM
12x I appreciate the feedback. I was looking at different gumpwaits and I had been looking at yours on your cart trainer. I truly don't understand namespace at all so I will have to look at gumpwaits and see what I can learn.

Ximan helped me last one year with that one due to issues that I was having with timing, I never realized that there was such a drastic difference with timing between people. I think it got so complicated because of my issues with timing. Comcast has since bumped up our cable speed by leaps and bounds which is probably why there is such a difference between mine and others. Ximan helped me tremendously as you all are. I am learning so much and I really appreciate everyone's patience and advice!
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Tidus on January 06, 2014, 02:36:33 PM
Running Scriptuo Program this is the syntax error check that i am getting for 1.5.  It is hard for me to test fully when there are so many unused and unmatched subroutines.
Code: [Select]
Method count: 56
Command count: 56
*** Pass 1 - Label accounting:
*** Warning - GOSUB #menubutton - Line 72 has no matching SUBroutine
*** Warning - GOSUB *request - Line 73 has no matching SUBroutine
*** Warning - GOSUB %s - Line 214 has no matching SUBroutine
*** Warning - GOSUB countregs - Line 313 has no matching SUBroutine
*** Warning - GOSUB tm_advjournalscan - Line 487 has no matching SUBroutine
*** Warning - GOSUB item - Line 696 has no matching SUBroutine
*** Warning - SUBROUTINE startp - Line 163 unused
*** Warning - SUBROUTINE pausep - Line 171 unused
*** Warning - SUBROUTINE resumep - Line 183 unused
*** Warning - SUBROUTINE quitp - Line 194 unused
*** Warning - SUBROUTINE closed - Line 198 unused
*** Warning - SUBROUTINE init - Line 204 unused
*** Warning - SUBROUTINE craft - Line 212 unused
*** Warning - SUBROUTINE idle - Line 220 unused
*** Warning - SUBROUTINE end - Line 228 unused
*** Warning - SUBROUTINE checktinkertools - Line 497 unused
*** Warning - SUBROUTINE checkcarptools - Line 509 unused
*** Warning - SUBROUTINE skillcraft - Line 649 unused
*** Warning - SUBROUTINE item1 - Line 750 unused
*** Warning - SUBROUTINE item2 - Line 761 unused
*** Warning - SUBROUTINE item3 - Line 772 unused
*** Warning - SUBROUTINE item4 - Line 783 unused
*** Warning - SUBROUTINE item5 - Line 794 unused
*** Warning - SUBROUTINE item6 - Line 805 unused
*** Warning - SUBROUTINE item7 - Line 816 unused
*** Warning - SUBROUTINE item8 - Line 827 unused
*** Warning - SUBROUTINE item9 - Line 838 unused
*** Warning - SUBROUTINE item10 - Line 851 unused
*** Warning - SUBROUTINE gumpwait - Line 862 unused
*** Warning - GOTO _getcarptoolitem - Line 686 has no matching tag
*** Error - Braces not balanced. Imbalanced by: 1
Subroutine labels = 49
Tag labels = 9
43 Code block(s).
30 Warnings(s) encountered.
*** Pass 2 - Execution [SYNTAXCHECK]

If you can make these changes, it will help tremendously in us helping you.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Tidus on January 06, 2014, 02:46:43 PM
Funny timing, I decided this morning to train up carpentry so I can make some suits. I was going to write my own but decided I'd go ahead and test for ya.

Just a couple things I've run into so far-

1) The first thing I did was to get rid of all the opening of my journal, pack, skills, etc in the Setup sub. Not sure why you go through all of that but I always find it annoying when a script moves all my stuff around and I couldn't figure out a reason for it :) That could just be a XIIx-ism though.
2) It pulled Shadow Iron ingots out of my secure instead of regular ingots. I paused and moved some Iron into my pack so I could keep testing, it was able to keep going but it did pull more shadow ingots out since it had already set the %ingots to my stack of Shadow. You should either add some color checking when setting the %ingots var or just make it clear in your instructions that only Iron ingots should be in your secure.
3) After this it made a box, axed it, then made 9 Moulding Planes before I hit stop.

Keep it coming!!

X

Thanks for the input!

1. I guess the skills and journal is me being lazy and liking them in a specific place. I can remove that part and have my own copy with it in there.  ;D

2. Checking for colored resources is not something that I have messed with yet. I will put it in the script to have only iron ingots in the secure for now and look at learning the other later. Once I am good with it, I can add the check into the script.

3. I am not sure about it making 9 jointer planes. I had a problem with that a while ago and thought that I had it fixed. Do you happen to see a mistake that would cause it to happen? I tested it last night for a little over 3 hours and it ran smoothly making only 2 at a time. Could it be a timing issue?


I am currently working on a WoodWorker Deluxe which will include Carpentry, Bowcrafting, and Tinker trainers, craft arrows & bolts, craft fukiya darts, poison fukiya darts (for oracle), and craft logs into boards. This is a huge undertaking for me since I am learning but as of right now, I have the 3 trainers into one script and working. I love scripting even though it can get frustrating when you cannot find that one typo or wrong word that is messing everything up. I hope to start doing more advanced stuff in the near future.  8)

To find color of an ingot is quite simple.
Code: [Select]
if #findcol = 0
gosub moveit #backpackid %ResourceSecure #findid %_diff

The main thing to incorporate into that is to make sure you go through all your found items to see whether any of them have the correct #findcol

Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: 12TimesOver on January 06, 2014, 02:48:08 PM
Many of those subroutines are indeed used but they aren't called in a way that allows the Syntax checker to know this. I do the same thing all the time, stuff like "gosub #menubutton", stuff like that.

Crisis - ignore the Namespace stuff in my sub for now, yt has nothing to do with your timing issue. Just consider the gumpwait function itself. You can clean up A LOT of your script by simplifying things a bit :)

X
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Tidus on January 06, 2014, 02:51:11 PM
Many of those subroutines are indeed used but they aren't called in a way that allows the Syntax checker to know this. I do the same thing all the time, stuff like "gosub #menubutton", stuff like that.

Crisis - ignore the Namespace stuff in my sub for now, yt has nothing to do with your timing issue. Just consider the gumpwait function itself. You can clean up A LOT of your script by simplifying things a bit :)

X
gotcha. I never did that because i was always afraid that it would go crazy thinking i am trying to call that variable as the name.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: The Ghost on January 07, 2014, 08:46:20 AM
Been running ver 1.5 and it holding ground.    

 here some observation:
Line 603 you need to replace ingots for boards


 This is me playing trick on it to force it making tools .  I pause with the carpentry menu up, I remove the carpentry tool and kept one.  the script read that it have one tool remain trying to make new one  but it making stool. I know this is pouching it.  just saying   Now if I close the menu before hitting play, everything is fine.    

Start a new run clean
Update:
was able to walk away for 10 min and still running :)

Speak to soon.  Min 11:30
 My carptool just ghost on my pack making it to attempt to gain skill for while.   have to open main pack to kept going.


Damm  Min 20:50.

My pack is full of Stool now.  
clean it reset make last,  since fine now.

came back Min 38:41 (attempts 651)
pack have stool again.
clear pack and reset make lat again
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 07, 2014, 04:37:05 PM
I think I am more confused on gumpwaits. I have found quite a few different ways and they are very different.

Code: [Select]
set %gumpwait 5
wait %gumpwait

and

Code: [Select]
sub gumpwait
set %timer #SCNT + 5
 repeat
  until #CONTNAME = generic_gump || #SCNT > %timer
if #contname <> generic_gump
   {
   event macro 17 0
   wait 1s
   }
Return

and

Code: [Select]
set %timer #SCNT + 5
repeat
until #CONTNAME = generic_gump || #SCNT > %timer
set %clicktoolsx #CONTPOSX + %one ;clicks tools
set %clicktoolsy #CONTPOSY + %two
click %clicktoolsx %clicktoolsy f
return

and then what 12x posted

Code: [Select]
;#######################
;SUB XIIxGumpWait
;#######################
; %1 = Required: Gumpname 1
; %2 = Required only if using Gumpsize: Gumpname 2
; %3 = Optional: Gumpsize
; Returns #TRUE if gump occured before timeout, #FALSE if timeout occured
sub XIIxGumpWait
   namespace push
   namespace local nsXIIxGumpWait
   set !gName1 %1
   set !gName2 %2
   set !gSize %3
   set !_time #SCNT
   while #SCNT <= !_time + 5
      {
      if %0 > 2
         {
         if ( #CONTNAME = !gName1 && #CONTSIZE = !gSize ) || ( #CONTNAME = !gName2 && #CONTSIZE = !gSize )
            {
            namespace clear
            namespace pop
            return #TRUE
            }
         }
      else
         {
         if #CONTNAME = !gName1 || #CONTNAME = !gName2
            {
            namespace clear
            namespace pop
            return #TRUE
            }
         }
      }
   namespace clear
   namespace pop
return #FALSE


They all obviously work, so can it be as simple as the first one?
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: The Ghost on January 07, 2014, 05:10:00 PM
I know that CEO make script 12 years and the all still work event with all the change.  ( we did update the gump size)   made you can inspiration from him.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: MeWonUo on January 07, 2014, 06:17:27 PM

They all obviously work, so can it be as simple as the first one?



Yes, they can be as simple as the first one you showed.  However, your script will take 4.3 years to GM the carpentry skill if you are doing a hard wait of 5 seconds between clicks. :D   The real problem with doing it that first way in my opinion is that there is no safety built in if you were to get a lag spike.  If you lock up for more that that 5 seconds (or whatever you set it to), there is a good chance that the script will break.

There are about as many ways to write these subs as their are people trying to write them.  I personally use a variation of the second example you posted.

Code: [Select]
sub WaitForGump

set %failsafe_timer #scnt + 2
repeat
until #contsize = 620_459 || ( #scnt > %failsafe_timer )

Then move onto whatever is next in the chain of events..

For the life of me, I can't remember what script I was working on, but using #ContName was causing issues for me.  Ever since, I've used #ContSize instead.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: ximan on January 07, 2014, 09:15:07 PM
Quote
Been running ver 1.5

Crisis would you mind posting or pm'ing me the current version?  Want to compare some parts with your earlier inscription script.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Tidus on January 08, 2014, 06:53:46 AM

Code: [Select]
sub WaitForGump

set %failsafe_timer #scnt + 2
repeat
until #contsize = 620_459 || ( #scnt > %failsafe_timer )

Then move onto whatever is next in the chain of events..

For the life of me, I can't remember what script I was working on, but using #ContName was causing issues for me.  Ever since, I've used #ContSize instead.


Using #contsize is the best in my opinion.  Only because every gump has a specific size.  So you can easily code that part to test for multiple cont sizes.

Code: [Select]

gosub contwait 620_459 5

sub contwait

set %timer #scnt + %2
repeat
until #contsize = %1 || ( #scnt > %timer )
return


Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: 12TimesOver on January 08, 2014, 07:15:08 AM
That's why a good Gumpwait sub should be able to use both Gumpname and Gumpsize :)

The issue with relying on Gumpname is that there are so many different gumps called "generic_gump". Adding an optional gumpsize to the wait sub gives that added flexibility for when you really want to make sure.

-----

Crisis - The issue with that first one is that it's not waiting until there is a gump, it's waiting for a 5 count only. What if the gump doesn't come up until the 6 count, well now your script is broken.

A basic gump wait sub needs to follow some basic gump wait logic:

Code: [Select]
sub gumpwait
   1) tell me what gump to wait for via name and/or size
   2) set an amount of time to keep looking for the gump before deciding it ain't comin'
   3) keep looking for that gump until it either shows up or the amount of time has expired
   4) tell the rest of the script what happened
return

This is all my example sub above is doing.

Code: [Select]
;#######################
;SUB XIIxGumpWait
;#######################
; %1 = Required: Gumpname 1
; %2 = Required only if using Gumpsize: Gumpname 2
; %3 = Optional: Gumpsize
; Returns #TRUE if gump occured before timeout, #FALSE if timeout occured
sub XIIxGumpWait
   namespace push
   namespace local nsXIIxGumpWait
This is creating the sub and giving it a namespace so that none of it's variables will conflict with the rest of the variables in the script that's calling it

Code: [Select]
   set !gName1 %1
   set !gName2 %2
   set !gSize %3
   1) tell me what gump to wait for via name and/or size

Code: [Select]
   set !_time #SCNT
   while #SCNT <= !_time + 5
   2) set an amount of time to keep looking for the gump before deciding it ain't comin'

Code: [Select]
   while #SCNT <= !_time + 5
      {
      if %0 > 2
         {
         if ( #CONTNAME = !gName1 && #CONTSIZE = !gSize ) || ( #CONTNAME = !gName2 && #CONTSIZE = !gSize )
            {
            namespace clear
            namespace pop
            return #TRUE
            }
         }
      else
         {
         if #CONTNAME = !gName1 || #CONTNAME = !gName2
            {
            namespace clear
            namespace pop
            return #TRUE
            }
         }
      }
   3) keep looking for that gump until it either shows up or the amount of time has expired
   4) tell the rest of the script that it did come up

Code: [Select]
   namespace clear
   namespace pop
Cleanup my namespace

Code: [Select]
return #FALSE   4) tell the rest of the script that it DID NOT come up
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: 12TimesOver on January 08, 2014, 07:25:41 AM
I think I am more confused on gumpwaits. I have found quite a few different ways and they are very different.
I figured I'd reply to each one of your examples since I posted about mine already.

Code: [Select]
set %gumpwait 5
wait %gumpwait
This does not wait for anything in particular, it's just a wait. If the Gump you're waiting for takes more than .25 seconds to come up this will break the rest of your script. This is the same as just saying "wait 5".

Code: [Select]
sub gumpwait
set %timer #SCNT + 5
 repeat
  until #CONTNAME = generic_gump || #SCNT > %timer
if #contname <> generic_gump
   {
   event macro 17 0
   wait 1s
   }
Return
This one is configured to ONLY look for a specific gump, "generic_gump", then if it doesn't see it it attempts to use last object again and returns to the script. Not a very good example of solid logic (sorry to anyone who owns this).

Code: [Select]
set %timer #SCNT + 5
repeat
until #CONTNAME = generic_gump || #SCNT > %timer
set %clicktoolsx #CONTPOSX + %one ;clicks tools
set %clicktoolsy #CONTPOSY + %two
click %clicktoolsx %clicktoolsy f
return
This is nothing more than a repeat/until loop that basically is saying "don't do anything else at all, nothing...and I mean NOTHING...until either the current gump is "generic_gump" or 5 seconds have gone by"! Then the script goes on to assume that the gump did indeed come up and starts clicking as if all is good. What if the gump was called something besides generic_gump or didn't come up at all? This snippet doesn't give a *bleep*, after 5 seconds it moves along like everything is hunky dorey.


Code: [Select]
;#######################
;SUB XIIxGumpWait
;#######################
<SNIP>
I already talked about this one :)

Quote
They all obviously work, so can it be as simple as the first one?
Well, nope they don't all work. In fact, none of them will work unless very specific criteria are met.

Hope this helps, and again, no offense intended toward anyone who may have written the above examples!

X
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: The Ghost on January 08, 2014, 10:29:10 AM
Seen like I open a can of worms.,

Thx for the lesson 12X,  getting a better understanding of the flow now.  I appreciated the time to explain all this.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: 12TimesOver on January 08, 2014, 10:57:35 AM
Seen like I open a can of worms.,

Thx for the lesson 12X,  getting a better understanding of the flow now.  I appreciated the time to explain all this.

Hey brother, you didn't open up a can of worms!! :) This is in response to Crisis' question with his examples, just trying to help out. I've never looked at CEO's code so have no idea how he handles Gumpwait's but I have faith that he is a better coder than I am! :)

X
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Tidus on January 08, 2014, 11:25:02 AM
Seen like I open a can of worms.,

Thx for the lesson 12X,  getting a better understanding of the flow now.  I appreciated the time to explain all this.

Hey brother, you didn't open up a can of worms!! :) This is in response to Crisis' question with his examples, just trying to help out. I've never looked at CEO's code so have no idea how he handles Gumpwait's but I have faith that he is a better coder than I am! :)

X

I think we are always in a state of learning when it comes to scripting.  There are so many ways to do different things that some are better for different situations than others.  Some are more deliberate for the one item and some can encompass many different abilities. 

That is the great thing about scripts, you can make the specific or you can make them general.  If you make alot of scripts for different things but want to use the same sub over and over, you can do that.

Or if you only want to write one script, there is no need for a general sub, make it specific to what you are doing.

THAT IS WHY I LOVE SCRIPTING AND FLOW CHARTS AND ALL OF THAT JAZZ!!!!!
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: 12TimesOver on January 08, 2014, 11:32:04 AM
Good point. There is always more than one way and "MY" best way may not be "THE" best way :)

X
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: ximan on January 08, 2014, 12:32:08 PM
The skeleton for this script was crisis' inscription trainer, which was a modification he did of someone's trainer, not sure of the provenance. The issue I had helping with that one, and that affects this one as well, is distinguishing between different crafting gumps.  Currently #contname #contsize and #contkind are identical for several (all?) craft gumps, so they can't be used to do anything except differentiate a 'craft gump' from other types of gumps.  Below is the original craft gump wait sub, more or less:

Code: [Select]
sub toolwait
  set %_tm #systime + ( %gumptimeout * 50 )
  gosub hardwait %gumpwait
  while #contsize <> %gumpsize
  {
    sleep 10
    if #jindex > %ji
    {
      for %_a %ji #jindex
      {
        scanjournal %_a
        if worn_out in #journal
        {
          return gettool
        }
        set %ji %ji + 1
      }
    }
    if #systime > %_tm
    {
      return false
    }
  }
return true

which is all fine.  The reverse problem, insuring a craft gump was not up, was solved by pre-positioning  the gump at a known safe location, then using the click command on the top left corner to see if #contsize changed.  I don't see any similar code in the current script, and without it, it'll generate a lot of items off of the wrong craft menu.

Actually telling the gumps apart would be the ideal solution, though I can't think of anything besides pixel scanning that will accomplish this in euox.  Didn't, then or now, have the time to undertake writing such a subroutine or related update tool.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 08, 2014, 12:59:30 PM
The skeleton for this script was crisis' inscription trainer, which was a modification he did of someone's trainer, not sure of the provenance. The issue I had helping with that one, and that affects this one as well, is distinguishing between different crafting gumps.  Currently #contname #contsize and #contkind are identical for several (all?) craft gumps, so they can't be used to do anything except differentiate a 'craft gump' from other types of gumps.  Below is the original craft gump wait sub, more or less:

The original one that you helped me with wasn't actually a modification of anyone's trainer but my feeble attempt at writing one. I went through all kinds of scripts and looked for simple code that I could semi-understand what it was doing. I then tried to write something that worked. I would write little snippets and run them and wait to see what happened. If it was successful or semi-successful,  I would add it to a main script. I think I did use a couple of sub's that were in the free to use sub section. The problem was that I did not understand how to combine them and I believe that I was missing a lot of stuff. When working on the original one and this one, I spent a lot of time abusing the google search looking at errors that others had things that were offered to fix them. I usually have at least 10 different windows open that have EUO and SUO information of some sort or another to look at and learn from.

I am a person that has to tinker and try things to understand them. You can give me a book about automobile engines, and I can memorize every line in it but I won't really understand it until I am neck deep in an engine looking at and tinkering with what it is talking about. I have an old motorcycle which runs but not very well but I am learning how it works and how to make repairs. If I mess something up, I take the part to a mechanic shop to get fixed but it is how I learn.

I appreciate all the help, I really do. I hope one day to have an entire script that is 100% mine without help but I have a feeling that day is a lot farther off than I thought it was.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: ximan on January 08, 2014, 01:27:51 PM
I'm not dissing how you made the script or how you learn, simply trying to explain why the script has the structure it does.  I just recall it starting out as a collection of subs which we wired together as a state machine, and a few of those subs (the ItemXX subs) dictated how items would be selected at different skill levels.  At first it was felt it ran too slowly if it always used (e m 17 0 ) the appropriate skill craft tool before each make last click, so that was pulled out and replaced with the gump present/ not present code described above (or so I thought).

Like most people, not everything is obvious to me either, and I appreciate a good tinkerer!  Just apologizing that I couldn't keep 'fixing up' the code as you evolved it to be able to test under my ( runuo ) environment, it's diverged too much, lol.  Anyway tackle the issue mentioned in my previous post and it should run smoother.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on January 08, 2014, 02:02:51 PM
I'm not dissing how you made the script or how you learn, simply trying to explain why the script has the structure it does.  I just recall it starting out as a collection of subs which we wired together as a state machine, and a few of those subs (the ItemXX subs) dictated how items would be selected at different skill levels.  At first it was felt it ran too slowly if it always used (e m 17 0 ) the appropriate skill craft tool before each make last click, so that was pulled out and replaced with the gump present/ not present code described above (or so I thought).

Yes that was it exactly, it was running very slowly and you were helping me make it move quicker. It was definitely a bunch of random/oddly scripted subs. When you first started helping me, it was a major Frankenstein script lol.

Quote
Like most people, not everything is obvious to me either, and I appreciate a good tinkerer!  Just apologizing that I couldn't keep 'fixing up' the code as you evolved it to be able to test under my ( runuo ) environment, it's diverged too much, lol.  Anyway tackle the issue mentioned in my previous post and it should run smoother.

You have nothing to apologize for at all. I was worried that my scripts may have been stretching your nerves. When I am in a zone, I want to make it work and understand it and I know I asked ALOT of questions lol.

I am sorry if I sounded defensive because I was in no means trying to. I was just explaining to anyone who has been following this thread how I do things and why. I cannot even begin to tell you you how much you have helped me in my understanding of how scripting works and how appreciative I am.

I feel that I am to the point where I can follow and understand a good portion of scripts out there. Some people write really complex scripts or scripts that use terminology that doesn't seem to relate to the script but I guess is put in place so others cannot copy or use their code and those scripts I cannot learn from. Some of your stuff blows my mind but I am also excited in the fact that I understand it a lot better then I did when you helped me with it. I will work some more on this script this weekend though I think I am going to look at redoing all the waits and gumpwaits because that where it seems to be failing everyone.

12X, your break down on your gumpwait was awesome, it helped me so much. Do you know if the EUO Wiki has information on symbols and their meaning such as !   l l  && etc?
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: 12TimesOver on January 08, 2014, 02:44:04 PM
Glad it was helpful Crisis!

At the EUO Wiki you want to look up Operators.

http://wiki.easyuo.com/index.php?title=Operators


X
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: ximan on January 08, 2014, 03:32:48 PM
Quote
I feel that I am to the point where I can follow and understand a good portion of scripts out there. Some people write really complex scripts or scripts that use terminology that doesn't seem to relate to the script but I guess is put in place so others cannot copy or use their code and those scripts I cannot learn from.

True there are some hard to understand scripts in the PSL, however the main purpose of publishing them is for people to use them.  Now that doesn't mean people encode their scripts to make them undecipherable. There are very few intentionally obfuscated scripts in the PSL (probably just prank scripts by Nilmer !), a lot of the really complex ones are that way because the authors were new to euox and were trying to make it act like a language they understood.  Just because they are complex doesn't mean are good scripting examples. Others do use some abstracting techniques that might remain opaque to someone without experience in programming.  If you ever happen across something that doesn't click, it never hurts to ask a question, lots of people obviously are willing to help out!

Pretty sure the only purposefully impenetrable code I've posted on easyuo was the following joke script (don't run it!).  See something like this just run away...

Code: [Select]
   set %e 7775
    set %peak 53
    set %q ea . k
    set %maximus 5
    set %or 4
    set %mode m
    set %a abcdefghijklmnopqrztuvwxsy:\/.?&"0123456789 , #spc
    
    gosub init 1337 mode
    while #true
    {
    set %z5 570917802538768004912152433248
    +3084387630663248787540064006387612309
    +1213876511040067875400338767875387670
    +9478750480912169442191219151107875976
    +8306691212191219114063066802554954006
    +4006387691219768308451293876091778753
    +876091741388004
     gosub run
    }
    stop
    
    sub run
    set %id id
    set %x 1
    set %z 6
    set %z4 590917802538768004912152433248
    +3084387630663248787540064006387612309
    +1213876511040067875400338767875387670
    +9478750480912169442191219151107875976
    +8306691212191219114063066802554954006
    +4006387652434006549591212304140638760
    +91778753876091741388004
    set %t
    set %t_
    set %t__
    while %x < %z
    {
     str left %z . %x 2
     set %zz #strres * %or
     set %y 3
     while %y < %zz
     {
       str mid %z . %x %y %o . r
       set %t_ % . #strres
       str %mode , %id % . a %t_ 1
       set %t__ %t__ , #str . res
       set %y %y + 4 % 444
     }
     set %q . %x %t__
     if %x > 3 2
       %q . 1 %q . 2 %q . 3 %q . %x
       set %q . %x
     set %t__
     set %x %x + 1
    }
    set %q1 %z10
    set %q2 %z20
    set %q3 %z30
    return
    
    sub init
    set %z1 079121512991215243976814069121
    set #lpc %e
    set %0 %1
    set %p %2
    set %z2 075243048048908408912151299121
    for %x 0 %p . %q
    {
     set %s . %x % . %x * % . %x
     set %s . %x %e , %s . %x
     str len %s . %x
     set %2 #strres - %maximus
     str mid %s . %x %2 4
     set %y 1 + % . x
     set % . %y #strres
     set %t % . %y
     set % . %t %x + 1
     set %s . %x
    }
    set %z3 170917140602403135064038760917
    +9121024030842304387609171926024030842
    +304
    return

Spend enough time scripting you'll understand it all...
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: The Ghost on December 30, 2014, 08:03:00 AM
Just to wake up this post again. 

 I had to make a new carpenter yesterday. Shard Xfer again. 

So look up for the script and load the later Ver I had. Ver 1.1.   Put 100k board in the bank and hit play and walk way.  Yes I was GM 12 or 14 hrs later.    I did use my monster PC that time and had ping of 92ms.   But no problem what so ever running this version.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on December 30, 2014, 09:50:04 AM
That's good to know! I am currently stuck on integrating the gump wait and crafting section. I have a lot of ideas but stuck on specific things. I have been looking at a lot of different types of scripts and I am trying to learn how they all work. I have been thinking of reviving my old walk through learning attempt script on making a script.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Endless Night on October 17, 2015, 10:03:09 AM
Crisis  .. Let me know when you feel this script has reached a level of finishedness to test for placement in the script library.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Crisis on October 17, 2015, 04:00:10 PM
I forgot about this one.  :-[  I have made some progress in my skills since then so I will try and adjust the gump wait so slower connections/computers don't get stuck.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: The Ghost on September 23, 2017, 02:52:53 AM
I had to train a new carpenter,  and I like this one.   

Nothing wrong with the build.  just an observation I notice.

Run smooth until it was time to do Quarter Staff and default back to stool.  I do have some lag ( 130 ATM)    So for me it the click for furniture and weapon my issue.. I'm nor upset of the fact that my 94k board are gone making stool :)   Price of doing business at night :)     
 I will look for a manual option if you have lag to add a pause so it have time to select the right categories.       

Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Piller on November 09, 2022, 08:27:31 AM
It said testers needed so I thought I would run it threw to see how it goes.

house storage osi shard.
GM tinker
started @ skill 0

19.9 skill the script had my backpack full of stools and was trying to loot boards from the secure and could not due to overweight
Paused using the script menu
Cleaned out pack restarted
When I restarted the status is speeding threw: checking boards, snooping for garbage, attempting gains
Stoped script and did a hard restart
I looks like I slid the menu off the screen a little and this was causing it. Slid the menu back to center screen and is up and running again



Is there any way when I pause a script to tell what line it is on so I can report where this stuff happened?
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Piller on November 09, 2022, 11:08:24 AM
loading the backpack with stools happened again almost right away. I was using an axe in my pack. I restarted and equipped the axe and has been running fine. I am not a scripter and do not know if that might have anything to do with it or not
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Gaderian on November 09, 2022, 10:03:25 PM
Script run controls are F keys.
F6 will run until returning from the current sub or called script.
F7 is used to step one line at a time through a script.
F8 is used to run a line without pausing for it.

F7 generally doesn't function well when there is a block of code with a timer. You will be too slow for the timer not to expire. That can take a path through a false timeout logically...
When pausing for each line is useful, then F7 works well to step through the script and give you the opportunity to examine variables.
Title: Re: Crisis Carpentry Trainer Beta 1.0 *Needs Testers Please*
Post by: Piller on November 10, 2022, 04:18:44 AM
Script run controls are F keys.
F6 will run until returning from the current sub or called script.
F7 is used to step one line at a time through a script.
F8 is used to run a line without pausing for it.

F7 generally doesn't function well when there is a block of code with a timer. You will be too slow for the timer not to expire. That can take a path through a false timeout logically...
When pausing for each line is useful, then F7 works well to step through the script and give you the opportunity to examine variables.

Thank you this will be very helpful when trying to help you smart people debugging scripts. tonight i will try them in something to see it function.

as far as the carpentry using an axe in my hand and keeping the crafting menu fully on the screen it ran flawless from 50-gm last night