Author Topic: Trick or treat starter  (Read 23904 times)

0 Members and 1 Guest are viewing this topic.

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 490
  • Activity:
    0%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +283
  • Referrals: 3
    • View Profile
Re: Trick or treat starter
« Reply #15 on: October 21, 2020, 07:28:57 PM »
+1
You had chosen the Random Rune travel routine, so I was just following your lead with my example/suggestion. The rune "+ 2" logic meant that you setup 2 runes at each location. It would try the first one, but if blocked, then it would try the second one setup for near the first one in the pair.

That means you need 32 runes for 16 locations (16 locations, 2 runes marked close to each other to avoid being blocked as much).

When you reset the starting rune number, you would swap to the next rune book. If the rune book number exceeds your number of rune books, then you reset it to the first one.

So you could have runebooks named:
trickortreat1
trickortreat2
trickortreat3

and either hard code a value for how many runebooks you have
set %NumberRunebooks 3
or inventory the books in your main backpack in a setup routine, which is well beyond the scope of current application.

Now you would increment the runebook index each time it resets the starting rune number...
Then check if your rune book index exceeds %NumberRunebooks, you reset the runebook index to 1.

That could make a nice reusable routine for future scripting projects. ;)

Now as for having less than 16 runes in a book, there is the very obvious line:
Code: easyuo
  1. if %RuneLocStart > 16
  2.  set %RuneLocStart 1
which would get changed to reflect how many runes you have in your book:
Code: easyuo
  1. if %RuneLocStart > 7 ; means 7 rune locations in the book...
  2.  set %RuneLocStart 1

Gaderian


"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Trick or treat starter
« Reply #16 on: October 21, 2020, 08:21:59 PM »
+1
GOTCHA!!!
I only used the random because that was the only one i could get working. Which was the issue. I couldn't get any of the others to change runes, that is what I was really after.

Lets say I want to do sequential recall then, which is what I tried to do, but couldn't figure out how from the header.
I would much rather randomize my runes in the book at this point and recall sequentially 1- 16. Maybe when I get rid of my scripter pacifier I'll try the random multi book thingy.

While I figure THAT part out, which won't take a lot of code rearranging i think, I have gone ahead and fleshed out the bank and trash routines, with the option (hardcode for now) to save candy or trash it.
This is totally untested. I will not have the time until late tomorrow. If someone brave wants to take a stab, here it is.
Need one rune book with 16 trick or treat target runes named TrickOrTreat1.
One rune book with 16 bank runes named Bank
One rune book with 6 runes to trash barrels named Trash
2 empty bags in your bank (1 if you want to trash the candy)
It'll take about 12 hours to fill a 125 spots, or about 10 specials an hour. ish. I don't have a bank is full option coded, so it's up to you to watch that.

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
BL Trick Or Treat Recall v03.txt
« Last Edit: October 21, 2020, 08:33:54 PM by baldielocks »

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 490
  • Activity:
    0%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +283
  • Referrals: 3
    • View Profile
Re: Trick or treat starter
« Reply #17 on: October 21, 2020, 08:33:35 PM »
+1
Here is an example where you have to setup the 4 parameters that get passed... this would need the runebook id changed from XXXXXX to whatever it really is. This would only use the first rune in the book and Recall method.
Code: easyuo
  1. set %Travel_Method RE ; recall
  2. set %RuneFirst 1
  3. set %RuneLast 1
  4. set %RunebookID XXXXXX
  5. gosub TM_TravelFromRunebook %Travel_Method %Runefirst %RuneLast %RunebookID
  6. if #result = #True
  7.  {
  8.  ; error while trying to travel ... probably from bad parmaters passed
  9.  }
  10.  

Gaderian
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Trick or treat starter
« Reply #18 on: October 21, 2020, 08:51:49 PM »
+1
ok. I want to advance the rune book by one rune when I run out of targets. As you say (i think) control the variable.
Code: [Select]
finditem HS_IS G_4 ;find trick or treat targets
    if #findcnt = 0 ; Teleported or all targeted, go to next rune in book.
    {
        ignoreitem reset ; clear queue
set %RuneLocStart %RuneLocStart + 1 ; start at first rune? I think this is how?
if %RuneLocStart > 16
 set %RuneLocStart 1
set %RuneLocEnd %RuneLocStart + 1 ;since runelocend is always one greater, should it reset to 1 first?
if %RuneLocEnd > 16
set%RuneLocEnd 1

gosub TM_TravelFromNamedRunebook RE %RuneLocStart %RuneLocEnd %BookName
    }

Offline Oracle

  • Hero Member
  • *
  • Posts: 888
  • Activity:
    0%
  • Reputation Power: 14
  • Oracle barely matters.Oracle barely matters.
  • Gender: Male
  • We always want something that we cannot have...!
  • Respect: +188
  • Referrals: 3
    • View Profile
Re: Trick or treat starter
« Reply #19 on: October 21, 2020, 10:46:27 PM »
+1
Testing .03 version. Have 3 books in my backpack 1. Bank 2. Trash 3. TrickOrTreat1

Starting up the script at the bank and it asks me to target a secure. So I target a bag in my bank box, then it goes to trick or treating but the target stays up. I click on the NPC and then another target cursor comes up. when I T and T all the NPCs it recalls to the next sot, but the same thing it leaves the target still up after it calls out Trick or Treat.
« Last Edit: October 21, 2020, 11:34:45 PM by Oracle »
ORACLE
Get me a Straw...because I suck...!
PIXEL CRACK -- Love it! Crave it! Want it! Got to have it!

Offline Gaderian

  • Elite
  • *
  • *
  • Posts: 490
  • Activity:
    0%
  • Reputation Power: 10
  • Gaderian barely matters.Gaderian barely matters.
  • Respect: +283
  • Referrals: 3
    • View Profile
Re: Trick or treat starter
« Reply #20 on: October 22, 2020, 01:35:48 AM »
+1
If you want to advance a single rune then use the Start and End rune location as the same value when you gosub to the TM_Travel... routine.

The only reason to have more than 1 location is if you want it to drop through to an additional rune when it fails.

You must supply both the start and end rune slot number on the gosub line - even if it is a single location that you want to recall to...

If it were me, I would test this out for blocked locations. Login with a second character and have it stand on your recall spot. Or use one of the carpentry red boxes that low level carpenters can make - set that on your recall location and test out the script. When blocked, does it recall indefinitely or does it give up and return "#result = #true" so you can script accordingly?

Gaderian
"Go ahead ask me: 'Should I use hard waits or timers?'"
You say:"Should I"
Gaderian:"Timers!"
You Say:"use hard waits or timers?"

The serious side of timer use is illustrated here: http://www.scriptuo.com/index.php?topic=12094.msg101926#msg101926

However, every time I go back and look at this [AutoLooter] script, I realize I had wrote it in my zen state of EUO scripting - so it makes my brain hurt.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Trick or treat starter
« Reply #21 on: October 22, 2020, 06:40:29 AM »
+1
Oracle, thanks for the test. I broke it last night trying to get fancy and was too tired. I got an extra hour so I fixed and partly tested. I did not test the trash sub, but the bank subs work fine. I updated the script to recalling straight through all locations for the beta file below. I did find a couple of specials ID's I had to add. If you find any, let me know and I'll get the types added. Thanks for testing!! If You find any I missed, post em here and I'll get them added.

still finding stuff I don't have in the specials yet. I know I'm missing the north/south webs. The Type is in the %loot list, but since I don't know what it is, I haven't moved it yet. THis could create a problem if you are dumping the candy, as they are getting dumped too.

Another minor issue is blocked runes. When I change the end location variable to +1, it tries to recall the the blocked rune, then stops. When I have it = the start location, it recalls over and over, then stops. Welcome any advice on this! (hint hint nudge nudge Gaderian)


There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
BL Trick Or Treat Recall beta.txt
« Last Edit: October 22, 2020, 12:05:15 PM by baldielocks »

Offline Oracle

  • Hero Member
  • *
  • Posts: 888
  • Activity:
    0%
  • Reputation Power: 14
  • Oracle barely matters.Oracle barely matters.
  • Gender: Male
  • We always want something that we cannot have...!
  • Respect: +188
  • Referrals: 3
    • View Profile
Re: Trick or treat starter
« Reply #22 on: October 22, 2020, 02:47:54 PM »
+1
This is what I found:

The script freezes if an NPC is too far away
When teleported it freezes at the Moongate
There is no option to trash the candy -- the script just asks me to target a secure in my bank box
If the rune is blocked then it casts recall over and over


So far...


ORACLE
Get me a Straw...because I suck...!
PIXEL CRACK -- Love it! Crave it! Want it! Got to have it!

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Trick or treat starter
« Reply #23 on: October 22, 2020, 03:05:54 PM »
+1
Never had the freeze with npc distance. I'll see if I can duplicate so I can fix it.

Waiting for someone WAY smarter than me (which is almost anyone) for advice on the blocked rune. It seems to be getting stuck in the TM random journal sub. I think I may have squashed this by downloading and pasting in a fresh copy of the TM travel sub.

Found and fixed an issue with it begging from the runebook.

Added South facing web type.

I have been running it all day, and frozen once at a moongate after a lag spike. I'm wondering if it is a latency issue. Otherwise, it seems to handle to teleport really well.

TAt the top of the script change %savecandy to #false. Change %trashcandy to #true. That should fix that portion.
Attached an updated betaV2 for you. That will fix some of it I hope.

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
BL Trick Or Treat Recall betaV2.txt
« Last Edit: October 22, 2020, 04:48:22 PM by baldielocks »

Offline Oracle

  • Hero Member
  • *
  • Posts: 888
  • Activity:
    0%
  • Reputation Power: 14
  • Oracle barely matters.Oracle barely matters.
  • Gender: Male
  • We always want something that we cannot have...!
  • Respect: +188
  • Referrals: 3
    • View Profile
Re: Trick or treat starter
« Reply #24 on: October 22, 2020, 04:28:46 PM »
+1
Which one is the newer one? The 19kb or the smaller one?
ORACLE
Get me a Straw...because I suck...!
PIXEL CRACK -- Love it! Crave it! Want it! Got to have it!

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Trick or treat starter
« Reply #25 on: October 22, 2020, 04:46:29 PM »
+1
The smaller one. I THOUGHT I had deleted the other. My bad! Fixed now.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Trick or treat starter
« Reply #26 on: October 22, 2020, 06:14:43 PM »
+1
It will only bank when full, then it cleans out the pack. I got super lucky with the teleport handling, and not on purpose. It turned out the way I set the script up, that either it will recall right after the teleport happens, or it will do an npc scan, return null, and recall to the next rune. Thanks Ghost!

Do you know how to get the item types if you find anything I don't have listed as special yet?

Offline Oracle

  • Hero Member
  • *
  • Posts: 888
  • Activity:
    0%
  • Reputation Power: 14
  • Oracle barely matters.Oracle barely matters.
  • Gender: Male
  • We always want something that we cannot have...!
  • Respect: +188
  • Referrals: 3
    • View Profile
Re: Trick or treat starter
« Reply #27 on: October 22, 2020, 06:17:01 PM »
+1
Running great so far -- over 2 hours... I am waiting to see the trash routine.

When it started the first bank run, it did not place anything in the bank. It then went to a Trick or Treat Spot, then a bank, then a Trick or Treat spot -- rinse repeat...

I am watching it -- so it is semi-AFK. when it gets to a rune hat is blocked I manually open the runebook and set the default to the next rune in the book. Don't know how it started on the bank runebook alternating

I watched it Bank the specials but my backpack is full of candy. I think that is why he keeps going to the banks. It is not getting to the trash book

« Last Edit: October 22, 2020, 06:21:31 PM by Oracle »
ORACLE
Get me a Straw...because I suck...!
PIXEL CRACK -- Love it! Crave it! Want it! Got to have it!

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Trick or treat starter
« Reply #28 on: October 22, 2020, 07:06:27 PM »
+1
As a double check, is %trashcandy set to #true at the top?

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +94
  • Referrals: 5
    • View Profile
Re: Trick or treat starter
« Reply #29 on: October 22, 2020, 07:57:20 PM »
+1
Im working on the trash issue. It's skipping the gosub even though %trashcandy is #true. As a work around, do the second bag option in your bank. It will take up an additional 24 items though.
Okay, got it fixed. Turned out I was being fancy again, and as Ghost would say "KISS!"
I'm not seeing any more recasting with blocked runes. It gets blocked once, then recalls to a random rune. Can you see if it is working now in this version for you?
In Beta V3:
Got rid of %trashcandy. If %savecandy true, it banks it. If false, it trashes it.
Added 4 new special types
Added in bank full protection
Added in backpack full protection

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
BL Trick Or Treat Recall betaV3.txt
« Last Edit: October 22, 2020, 08:22:12 PM by baldielocks »

Tags: