Author Topic: This one last thing I need to fix....  (Read 4246 times)

0 Members and 1 Guest are viewing this topic.

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
This one last thing I need to fix....
« on: October 10, 2013, 02:39:29 AM »
0
Probably most of you here already have a sub to do this, but maybe not all...  

Anyway, after all these years of knocking tables over, and bashing into walls and even occasionally running over the edge of my houses foundation - I decided that it was really stupid that I didn't write a little sub to ALWAYS have me WALK in my house - without me having to hit a freekin' key or click a menu every damn time... I mean if we can write scripts that fight or mine or whatever for us, then we should certainly be able to have our char always walk when he/she's in the damn house (and other places to, like the bank) - AUTOMATICALLY.

So I sat down and look'd at the wiki and it dawned on me that we have an event macro toggle for walk/run (I know - it's assigned to my F9 key and a button on damn near every menu I've got)...
And then I said to myself, hmmmmm.... that shows up as a message whenever it's toggled.... So why not have a sub that hits that toggle and then acts according to what it tells me?

And by jove, it works almost perfectly....

Here's where TM or EN or one of you elites can help me perfect this little bugger.... I have to almost try to get it to fail, but it will fail the way it is - which is, of course, unacceptable...

Here's what it does wrong:  

IF I run it 2 or 3 times in a row, (so nothing is in the journal besides the walk/run off/on message) it will take the wrong action and switch wrongly.
I'm sure that it has to do with my usage of TM's TravelFromRunebook sub that it depends on to check the journal message....
What would be the correct parameter in this case?

Here's the sub:

Code: [Select]
Sub WalkAtHome
event macro 32 0 ;run On/Off
wait 3
gosub TM_AdvJournalScan WalkRun VALID_ADVANCE now_on
  if #RESULT = #TRUE
     {
     event macro 32 0 ; Toggle it Off
     wait 3
     }
  else
     {
     wait 1
     }
Return

I know how Kal In Ex would code this....  His script would say:  "If you're on any one of the tiles within this boundry, then you will walk." 

Well, he's smarter than I am when it comes to this stuff...
« Last Edit: October 10, 2013, 02:45:14 AM by Grandewd »

Offline dxrom

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: This one last thing I need to fix....
« Reply #1 on: October 10, 2013, 03:43:37 AM »
0
Couldn't you just use a rail and then call to it when you want to walk?



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

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: This one last thing I need to fix....
« Reply #2 on: October 10, 2013, 04:31:44 AM »
0
Well someone who is familiar with tms journal subs is going to have to answer the specifics on this question .. but I would say you need something that resets/sets the journal start position right before you do the event macro command.

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 GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Re: This one last thing I need to fix....
« Reply #3 on: October 10, 2013, 11:50:08 AM »
0
Well someone who is familiar with tms journal subs is going to have to answer the specifics on this question .. but I would say you need something that resets/sets the journal start position right before you do the event macro command.



Yea, exactly... Hopin' TM might come across this and respond...

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Re: This one last thing I need to fix....
« Reply #4 on: October 10, 2013, 11:52:05 AM »
0
Couldn't you just use a rail and then call to it when you want to walk?

Sure, I use a short rail whenever I go home... But that doesn't address the need to always WALK, not run... If he's already walking, do nothing.  If he's running, make him walk.... Then kick in the rail to move...

Offline The Ghost

  • Elite
  • *
  • *
  • Posts: 1917
  • Activity:
    0%
  • Reputation Power: 25
  • The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.The Ghost is on the verge of being accepted.
  • Respect: +245
  • Referrals: 0
    • View Profile
Re: This one last thing I need to fix....
« Reply #5 on: October 10, 2013, 11:58:16 AM »
0
TM often tell me to play with   VALID option  try this and see it if work better and let hope you have  the sub at the right place too.

gosub TM_AdvJournalScan WalkRun VALID now_on

Offline ximan

  • Jr. Member
  • **
  • Posts: 98
  • Activity:
    0%
  • Reputation Power: 1
  • ximan has no influence.
  • Respect: +16
  • Referrals: 1
    • View Profile
Re: This one last thing I need to fix....
« Reply #6 on: October 10, 2013, 12:12:46 PM »
0
This just relies on #sysmsg, first saw this trick in an RK script ... presumes you don't mess with run/walk status except via the walkrun sub:

Code: [Select]
set %isrunning x ; 0 - walking, 1 - running
gosub init
display ok %isrunning
gosub walkrun
display ok %isrunning
halt

; places client and isrunning in known state (walking).
sub init
  repeat
    set %temp #sysmsg
    if Always_Run_is_now_off. in %temp
    {
      set %isrunning 0
      return
    }
    wait 2
    event macro 32 0
    wait 3
  until #false
return

; %0 0 - toggle; %1 0 - walk, 1 - run
sub walkrun
  if %0 = 0
    goto toggle
  if %1 = %isrunning
    return
  toggle:
  event macro 32 0
  set %isrunning ( %isrunning + 1 ) % 2
  wait 3
return


Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Re: This one last thing I need to fix....
« Reply #7 on: October 10, 2013, 03:34:12 PM »
0
TM often tell me to play with   VALID option  try this and see it if work better and let hope you have  the sub at the right place too.

gosub TM_AdvJournalScan WalkRun VALID now_on

Yup, that's exactly what I just tried... And so far, it hasn't failed....
« Last Edit: October 11, 2013, 11:53:47 AM by Grandewd »

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Re: This one last thing I need to fix....
« Reply #8 on: October 10, 2013, 03:37:19 PM »
0
This just relies on #sysmsg, first saw this trick in an RK script ... presumes you don't mess with run/walk status except via the walkrun sub:

Code: [Select]
set %isrunning x ; 0 - walking, 1 - running
gosub init
display ok %isrunning
gosub walkrun
display ok %isrunning
halt

; places client and isrunning in known state (walking).
sub init
  repeat
    set %temp #sysmsg
    if Always_Run_is_now_off. in %temp
    {
      set %isrunning 0
      return
    }
    wait 2
    event macro 32 0
    wait 3
  until #false
return

; %0 0 - toggle; %1 0 - walk, 1 - run
sub walkrun
  if %0 = 0
    goto toggle
  if %1 = %isrunning
    return
  toggle:
  event macro 32 0
  set %isrunning ( %isrunning + 1 ) % 2
  wait 3
return


Hey ximan...  I LOVE your use of #sysmsg to accomplish the same thing... Sorta brilliant....  I haven't tried it yet, but I did read thru it and certainly theoretically it should work perfectly...  :o

I'll give it a shot later and let ya know...

Oh, and thanks for responding...

Offline GrandewdTopic starter

  • Full Member
  • ***
  • Posts: 239
  • Activity:
    0%
  • Reputation Power: 3
  • Grandewd has no influence.
  • Respect: +24
  • Referrals: 0
    • View Profile
Re: This one last thing I need to fix....
« Reply #9 on: October 15, 2013, 02:02:58 AM »
0
This just relies on #sysmsg, first saw this trick in an RK script ... presumes you don't mess with run/walk status except via the walkrun sub:

Code: [Select]
set %isrunning x ; 0 - walking, 1 - running
gosub init
display ok %isrunning
gosub walkrun
display ok %isrunning
halt

; places client and isrunning in known state (walking).
sub init
  repeat
    set %temp #sysmsg
    if Always_Run_is_now_off. in %temp
    {
      set %isrunning 0
      return
    }
    wait 2
    event macro 32 0
    wait 3
  until #false
return

; %0 0 - toggle; %1 0 - walk, 1 - run
sub walkrun
  if %0 = 0
    goto toggle
  if %1 = %isrunning
    return
  toggle:
  event macro 32 0
  set %isrunning ( %isrunning + 1 ) % 2
  wait 3
return


Since you posted this ximan, I've use it in my script and it hasn't failed yet.... So tyvm....

I just can't seem to get the job done using scanjournal...  I'm beginning to wonder if you can use scanjournal to reliably tell you which walk/run state you're currently in... Would love it if someone could get that method to always work so I could see what I'm doing wrong...

In the meantime, you'rs works perfectly...  But it doesn't get me that submission I wanted... :)

Offline dxrom

  • Master of the milestones!
  • Elite
  • *
  • *
  • Posts: 1080
  • Activity:
    0%
  • Reputation Power: 15
  • dxrom is working their way up.dxrom is working their way up.dxrom is working their way up.
  • KEYBOARD COWBOY, GREAT SAMURAI OF THE INTERNET.
  • Respect: +100
  • Referrals: 1
    • View Profile
Re: This one last thing I need to fix....
« Reply #10 on: October 15, 2013, 09:27:28 AM »
0
So much effort for something that is one line in stealth :X

Code: [Select]
function MoveXY(Xdst, Ydst:Word; Optimized:Boolean; Accuracy:Integer; Running:Boolean):Boolean

To walk:
Code: [Select]
MoveXY(1,1,True,0,False);or to Run:
Code: [Select]
MoveXY(1,1,True,0,True);
« Last Edit: October 15, 2013, 09:29:19 AM by dxrom »



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

Tags: