Author Topic: Checking for Bankbox (Sub)  (Read 5651 times)

0 Members and 1 Guest are viewing this topic.

Offline GuadahTopic starter

  • Full Member
  • ***
  • Posts: 119
  • Activity:
    0%
  • Reputation Power: 3
  • Guadah has no influence.
  • Gender: Male
  • Who farted?!
  • Respect: +29
  • Referrals: 3
    • View Profile
    • L%N Website
Checking for Bankbox (Sub)
« on: September 14, 2011, 05:04:41 AM »
0
Code: [Select]
; ###########################################
; ###       CHECKING FOR BANKBOX          ###
; ###########################################
sub check_for_bank
menu set status Checking for your Bankbox
event macro 3 0 bank
 wait 10
gosub TM_AdvJournalScan bank VALID_ADVANCE Bank_container
if #result = #true
   {
   menu set status Looks like you're at the bank.
    wait 10
   return
   }
gosub TM_TravelFromRunebook RE %bank_rune %bank_rune %bank_book
gosub reopen_bags
return

Problem:  If you are not at the bank, it spams the whisper 'Bank' over and over.   Stuck.

What it's suppose to do:
Whisper 'Bank' then if you see in the Journal that the bank opened ("Bank_container") Then it returns, opening bags preset in the menu.
If it does not open (by not seeing "Bank_container" in the journal, it is 'supposed' to move onto the Sub to Travel, then Reopen_bags... however it never gets there.

I've followed the script by manually moving it along.  It whispers 'Bank' then moves into TM's Journal Handler, then returns to the whisper 'Bank'.  NO IDEA why it's doing that.

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Checking for Bankbox (Sub)
« Reply #1 on: September 14, 2011, 06:38:06 AM »
0
One of my pet peeves is more than one exit from a sub.. i'm a true believer in every sub should contain only one return .. so try my edit and see what you get

if you get the message Looks like you're NOT NOT at the bank. when in fact you are .. then you have an issue with the usage of tms subs.


Code: [Select]
; ###########################################
; ###       CHECKING FOR BANKBOX          ###
; ###########################################
sub check_for_bank
menu set status Checking for your Bankbox
event macro 3 0 bank
 wait 10
gosub TM_AdvJournalScan bank VALID_ADVANCE Bank_container

if #result = #true
   {
   menu set status Looks like you're at the bank.
    wait 10
   }
ELSE
  {
  menu set status Looks like you're NOT NOT at the bank.
  gosub TM_TravelFromRunebook RE %bank_rune %bank_rune %bank_book
  gosub reopen_bags
  }
return
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: Checking for Bankbox (Sub)
« Reply #2 on: September 14, 2011, 06:46:09 AM »
0
Seeing as you only have a single event macro 3 0 I'm assuming the issue isn't in the sub if it's repeating the "whisper bank" multiple times. BTW, did you initialize your journal somewhere in the script? That is part of TM's journal handling subs, you need to run the sync..

X

P.S. - I believe more than one return from a sub is sometimes the best option but I'm no EN ;)
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Checking for Bankbox (Sub)
« Reply #3 on: September 14, 2011, 10:38:51 AM »
0
Hmm... so EN you simply set a variable in your sub for what it will return once it gets to the end?

Is this simply coders preference? It seems like it would by much faster to simply make the sub exit as soon as possible instead of performing more checks before getting to the final return.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Checking for Bankbox (Sub)
« Reply #4 on: September 14, 2011, 10:52:48 AM »
0
Hmm... so EN you simply set a variable in your sub for what it will return once it gets to the end?

Is this simply coders preference? It seems like it would by much faster to simply make the sub exit as soon as possible instead of performing more checks before getting to the final return.

It is no faster in any meaningfull manner to exit the sub early.   You could compensate for anyslowness incurred buy doubling the LPC.

As to simply coders preference yes and no.  Its good coding practice, it means you have clear code that is easy to bebug especially by others.  If you have 2 4 6 8 10 or more exits from a single sub you can see how the complexitys of debuggin get more difficult.

If you look at my chartoolbox script you will see that in long subs i use this

 if !cancontine  {block of code}
 if !cancontine  {block of code}
 if !cancontine  {block of code}

So all i have to do is set !cancontinue #false and it goes all the way to the end of the sub. A good code parser wont even read the code in the block it will just skip it.


Anyway this isnt real coding so .. what ever works for you all is fine .. just my personal preferences is all.
« Last Edit: September 14, 2011, 11:05:44 AM by Endless Night »
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Checking for Bankbox (Sub)
« Reply #5 on: September 14, 2011, 11:20:40 AM »
0
I Shall Have to incorporate this into my work from now on for good practice.
Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: Checking for Bankbox (Sub)
« Reply #6 on: September 14, 2011, 11:25:22 AM »
0
Wow, why so complicated? have an indicateable Item(an ID or Type) in your Bank what you could scan for. When u find the ID your bank is open.I do this with a Decoration Item i never use it.

Offline manwinc

  • Elite
  • *
  • *
  • Posts: 2556
  • Activity:
    0%
  • Reputation Power: 32
  • manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!manwinc is a rising star!
  • Gender: Male
  • "The Devs Hard at Work"
  • Respect: +123
  • Referrals: 1
    • View Profile
Re: Checking for Bankbox (Sub)
« Reply #7 on: September 14, 2011, 11:36:12 AM »
0
I normally just do a check for the #contsize, I think a bank has a unique contsize, but I could be very very wrong on this.

Monkeys and Typewriters!

" Oh I know, We'll make a Boss Encounter that requires 3 keys per player to enter, Then we'll make it not a closed instance so you never know if you are going to pop into a fresh room or a boss that has 1% Health left with 20 dudes smashing its face in, wasting your time and effort"

Offline GuadahTopic starter

  • Full Member
  • ***
  • Posts: 119
  • Activity:
    0%
  • Reputation Power: 3
  • Guadah has no influence.
  • Gender: Male
  • Who farted?!
  • Respect: +29
  • Referrals: 3
    • View Profile
    • L%N Website
Re: Checking for Bankbox (Sub)
« Reply #8 on: September 14, 2011, 11:38:54 AM »
0
I'm opening the bank to get to Resource Bag(s).  If it doesn't find that the bank opened in the journal, it'll recall to the bank rune in my Runebook.  I'm then going to put in a safety check that once you recall to your bank rune, if you say bank and it doesn't open, it will halt the script and tell you to fix your rune location.

@EN  I like your changes, going to use those.  It didn't resolve the issue, but It's because I didn't initialize my journal.

@Crome.  You were right, I never initialized the journal.
« Last Edit: September 14, 2011, 11:42:13 AM by Guadah »

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: Checking for Bankbox (Sub)
« Reply #9 on: September 14, 2011, 11:39:36 AM »
0
I normally just do a check for the #contsize, I think a bank has a unique contsize, but I could be very very wrong on this.


When i remind right, Bank have same propertys than a Metal Chest. I could be wrong as well but with an indicator in your bank you have a 7 line Code for open Bank.

Code: [Select]
finditem %Indicator C
while #findkind = -1
{
Event macro 1 0 Bank
wait 10
finditem %Indicator C
}

Offline GuadahTopic starter

  • Full Member
  • ***
  • Posts: 119
  • Activity:
    0%
  • Reputation Power: 3
  • Guadah has no influence.
  • Gender: Male
  • Who farted?!
  • Respect: +29
  • Referrals: 3
    • View Profile
    • L%N Website
Re: Checking for Bankbox (Sub)
« Reply #10 on: September 14, 2011, 11:52:40 AM »
0
@Crome, I may have to adjust it to do that, but I like the way it's coded currently.

I don't get it, I deleted TM's ADVJOURNALSCAN Subs and replaced them in from a fresh download, just in case something was deleted, and it is still doing it.

bank
bank
bank

Blah

There are 1 attachment(s) in this post. You must register and post an acceptable introduction to download
Guadahs Slayer Spellbook Crafter v1.0.3.euo
« Last Edit: September 14, 2011, 12:15:28 PM by Guadah »

Offline Crome969

  • Elite
  • *
  • *
  • Posts: 2098
  • Activity:
    0%
  • Reputation Power: 25
  • Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.Crome969 is on the verge of being accepted.
  • Gender: Male
  • UO Enthusiast
  • Respect: +211
  • Referrals: 10
    • View Profile
    • ScriptSDK
Re: Checking for Bankbox (Sub)
« Reply #11 on: September 14, 2011, 12:14:31 PM »
0

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: Checking for Bankbox (Sub)
« Reply #12 on: September 14, 2011, 12:26:17 PM »
0
@Crome.  You were right, I never initialized the journal.
You mean, @12x ;)

BTW, I'm looking at your posted code and I still don't see you initializing the journal before calling TM's journal scan sub. You need to do this if you want your call to the TM_AdvJournalScan sub to actually work. You're telling the sub to scan a journal "index" called bank but you never created it beforehand.

I see that you are first calling your "check_for_bankbox" sub, then when the journal scan fails you're traveling then heading to the "reopen_bags" sub which immediately sends you back to your "check_for_bankbox" sub which is still going to fail every time on the journal scan.

Fix your journal synch and you will fix that piece of the code flow.

X
« Last Edit: September 14, 2011, 12:36:49 PM by 12TimesOver »
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline Endless Night

  • Global Moderator
  • *
  • *
  • Posts: 5467
  • Activity:
    0%
  • Reputation Power: 62
  • Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!Endless Night is awe-inspiring!
  • Respect: +393
  • Referrals: 1
    • View Profile
Re: Checking for Bankbox (Sub)
« Reply #13 on: September 14, 2011, 12:38:20 PM »
0
saw an intresting post the other day about bank boxes and that the bank box when opened can be found on your paperdoll

finditem <metalchesttype> CA_ , #charid
Outlaw Josey Wales - "Manwink, A Long Gone Scripty, and Endless are always teasing us with their private sections lol. What there realy saying is scripters rule and users drool."
Briza - "Your a living breathing vortex of usefulness."

Offline GuadahTopic starter

  • Full Member
  • ***
  • Posts: 119
  • Activity:
    0%
  • Reputation Power: 3
  • Guadah has no influence.
  • Gender: Male
  • Who farted?!
  • Respect: +29
  • Referrals: 3
    • View Profile
    • L%N Website
Re: Checking for Bankbox (Sub)
« Reply #14 on: September 14, 2011, 01:07:07 PM »
0
Very Cool EN THAT I can most defiantly use!

I wonder... is it possible to read what is written on the crafting menu's?  Say I go to make a spellbook, but click the wrong category, so I go to make the wrong item and it says "You do not have enough mandrake root to make that item."  It does not hit the Journal, but if I can scan the menu, I can prevent that from happening.

Tags: