Author Topic: Back to some basics  (Read 6763 times)

0 Members and 1 Guest are viewing this topic.

Offline SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Back to some basics
« on: August 16, 2010, 09:50:35 PM »
0
Believe it or not, I've never written a fully automated mining script.  I've only used others' and gave feedback about them, usually a compliment, thank you and possibly thoughts/suggestions.

Below is a snippet of what my question concerns, so here it goes.

Is it possible to dig the tile my char is standing on?  I've hit a few roadblocks with using the tile command and setting ltargetx/y, ltargettile.  I've been searching here and there for the past several hours and haven't come to an answer.

Code: [Select]
Sub MainLoop
  GoSub TM_RailInit

  set %dest 2
  While #clilogged = 1
  {
    ;pause
    set #lobjectid %CurrentShovel
    event macro 17 0
    set #LTargetKind 2
    click %xcoord %ycoord f ;d ;       #charposx #charposY  ;click
    wait 1s
    GoSub TM_AdvJournalScan mine VALID_ADVANCE You_destroyed full
    if #result = #true ; shovel broke or backpack full
      GoSub CheckResources
    if #weight > ( #maxweight - 5 )
      GoSub Smelt
    GoSub TM_AdvJournalScan mine VALID_ADVANCE no_metal can't_mine cannot_see
    if #result = #true
    {
      call %railsubs TM_DetermineCurrentWaypointIndex
      set #result #result + 1
      Call %railsubs TM_RunRail Private_Cave #result %dest FW
      wait 1s
      set %dest #result + 1
      if #result = 113
      {
        set %dest 2
        Call %railsubs TM_RunRail Private_Cave Present %dest FW
      }
    }
    GoSub TM_AdvJournalSync mine 100
  }
  GoSub Mount on
Return

Offline Outlaw Josey Wales

  • Full Moon Rising!
  • Hero Member
  • *
  • Posts: 595
  • Activity:
    0%
  • Reputation Power: 7
  • Outlaw Josey Wales has no influence.
  • Gender: Male
  • Respect: +59
  • Referrals: 2
    • View Profile
Re: Back to some basics
« Reply #1 on: August 16, 2010, 10:07:03 PM »
0
i want even protend to know anything about scripting but i will say this u have to mine at least one square in front of you not abel to mine under foot only exception is t hunting but it want let u dig it up when your standing on it so u have to move square

Offline SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: Back to some basics
« Reply #2 on: August 16, 2010, 10:35:22 PM »
0
Really? that's absurd. I can manually use the shovel, and target exactly between my feet. EUO is dumb if that can't be duplicated...*not directed at you Outlaw, just the principle.  It's probably something on my end if I can do it in game.

Offline Khameleon

  • Script Tester - Team Leader
  • Elite
  • *
  • *
  • Posts: 2574
  • Activity:
    0%
  • Reputation Power: 30
  • Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!Khameleon is a rising star!
  • Gender: Male
  • Respect: +238
  • Referrals: 0
    • View Profile
Re: Back to some basics
« Reply #3 on: August 17, 2010, 12:47:59 AM »
0
doesn't really matter where you dig SS, as long as you hit one of the tiles in the 8x8 resource grid.. if your lucky you can stand in the middle of a resource grid, and get all 4 Full Digs.. thats uh.. what 32 swings in trammel.

Offline Outlaw Josey Wales

  • Full Moon Rising!
  • Hero Member
  • *
  • Posts: 595
  • Activity:
    0%
  • Reputation Power: 7
  • Outlaw Josey Wales has no influence.
  • Gender: Male
  • Respect: +59
  • Referrals: 2
    • View Profile
Re: Back to some basics
« Reply #4 on: August 17, 2010, 12:58:31 AM »
0
Really? that's absurd. I can manually use the shovel, and target exactly between my feet. EUO is dumb if that can't be duplicated...*not directed at you Outlaw, just the principle.  It's probably something on my end if I can do it in game.
None taken was  just offering input if can help in any other way just hit me up

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: Back to some basics
« Reply #5 on: August 17, 2010, 02:58:39 AM »
0
Yes, you can mine the tile you're standing on with EUO.

Why doesn't the code you have above work? I mean, what happens? Where are you trying to mine?

X
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 SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: Back to some basics
« Reply #6 on: August 17, 2010, 02:01:43 PM »
0
I'm in a cave, and the message I get is 'you cannot see that'.  The click x & y coord's are as follows:

Code: [Select]
set %Xcoord ( #clixres / 2 )
set %Ycoord ( #cliyres / 2 ) + 75


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: Back to some basics
« Reply #7 on: August 17, 2010, 03:03:10 PM »
0
I'm in a cave, and the message I get is 'you cannot see that'.  The click x & y coord's are as follows:

Code: [Select]
set %Xcoord ( #clixres / 2 )
set %Ycoord ( #cliyres / 2 ) + 75
Check your #tilecnt detail? If you do a tile get on the tile you are standing on you will find that it has a number of unique "layers", you are probably trying to mine the wrong "layer". What I do is cycle with a For loop like "for %c 1 #tilecnt" then get the z value of that tile and set your dig point.

For fun, try this snippet:

Code: [Select]
set %dx #charposx
set %dy #charposy

tile init
tile cnt %dx %dy
Display The value of TileCnt is #tilecnt
for %c 1 #tilecnt
   {
   tile get %dx %dy %c
   display Tyletype is #tiletype , #spc , TileZ is #tilez , #spc , Charposz is #charposz , #spc , Tilename is #tilename
   }

halt

This should give you the detail for each "layer" of the tile you're standing on.

X
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 SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: Back to some basics
« Reply #8 on: August 17, 2010, 03:17:20 PM »
0
I never did a whole lot with tile, so my results of running that bit is 0...for everything.  The tilename is "blank", z coord's is 0, tiletype is 0 and tilecnt is 0.  Is that the issue? I'm 'sorta' on a zero tile level and therefore can't target a null value? That would make sense if that's the case. I'm in tram btw in a cave.

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: Back to some basics
« Reply #9 on: August 17, 2010, 03:54:46 PM »
0
hmmm, sounds more like my code is suspect or you're having other issues such as the known tile issue that requires a reg fix for example? It should come back with info including the tile name somehting like "Cave_Floor" for example.
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 SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: Back to some basics
« Reply #10 on: August 17, 2010, 04:13:35 PM »
0
I did just now place the registry fix and while it did resolve a razor error I've been experiencing for a while (nothing important), my results are still the same..all zero's and tilename is a blank value.  This is annoying that I can rail script the entire UO world, but can't dig at my feet and get the journal to work correctly..heh,..I'll live.

I suspect it's my location,..it's not exactly a known place or one anyone can get to.

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: Back to some basics
« Reply #11 on: August 17, 2010, 05:05:54 PM »
0
I did just now place the registry fix and while it did resolve a razor error I've been experiencing for a while (nothing important), my results are still the same..all zero's and tilename is a blank value.  This is annoying that I can rail script the entire UO world, but can't dig at my feet and get the journal to work correctly..heh,..I'll live.

I suspect it's my location,..it's not exactly a known place or one anyone can get to.
Does the snippet I gave you give you accurate results elsewhere? I'm assuming I know the place you're talking about ;)

x
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 SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: Back to some basics
« Reply #12 on: August 18, 2010, 04:43:42 AM »
0
So I tried the tile snippet you posted in a different location and it works just fine in other caves. I get 2 tile counts, one rock, and the other cave floor. So I'm sure now that the location I'm digging in is just funky as it was never designed to be used as such, and yes, I believe you do know where I'm talking about. :-X ;)

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: Back to some basics
« Reply #13 on: August 18, 2010, 04:46:25 AM »
0
Interesting. Well I have found that some locations have a different ltargetkind value but I would expect that you would get no message at all if that were the issue. Since you're getting a "can't see that" error I'm pretty confident you need to somehow adjust your z-axis.

X
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 SuperslayerTopic starter

  • Elite
  • *
  • *
  • Posts: 1006
  • Activity:
    0%
  • Reputation Power: 14
  • Superslayer barely matters.Superslayer barely matters.
  • Gender: Male
  • Well what do you drink? Not tea.
  • Respect: +43
  • Referrals: 0
    • View Profile
Re: Back to some basics
« Reply #14 on: August 18, 2010, 05:00:00 AM »
0
My character z-axis is 0. Should I target -1 or +1? I'll have to come back to this later today. I'm about to hit the sack for the night (I work 3rd shift, daytime is my nighttime).

Here's what I have that is working, but it targets 1 tile directly down from where my character stands.

Code: [Select]
set %Xcoord ( #clixres / 2 )
set %Ycoord ( #cliyres / 2 ) + 75

...

GoSub TM_AdvJournalSync shovel
set #lobjectid %CurrentShovel
set #LTargetKind 2
event macro 17 0
click %xcoord %ycoord f
wait 2
click %xcoord %ycoord f
wait 20
GoSub TM_AdvJournalScan shovel VALID You_destroyed
if #result = #true ; shovel broke
GoSub CheckResources
menu set MyWt My Weight: #weight
GoSub TM_AdvJournalSync shovel

Tags: mining