Shard is currently offline.



Take the Tour | Site Map

It is currently Thu Mar 21, 2019 8:45 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Mon Nov 19, 2018 6:40 am 
Offline
Script Kiddie
Script Kiddie

Joined: 10/09/2018 15:17
Posts: 8
This is a simple macro I wrote to find a 8x8 corner spot to mine all 4 nodes at once,
then when nodes run out, it will either repeat the macro, or run other scripts by using execute command.
problem is that when I choose to run other script, New easyuo client will open up successfully with the script loaded but it will say 'No supported UO Client found', and the script won't start.

On top of it, when I manually start the new macro on the execute-opened easyuo, it will freeze my UO client.

each of three macro runs fine if I use them individually.

Any idea what I am missing or doing wrong?

Code:
  1.  
  2. gosub starting
  3. sub starting
  4. {
  5.  event sysmessage click z to start
  6.  wait 20
  7.  gosub ToGrid
  8. }
  9. sub ToGrid
  10.  {
  11.   set %x N/A
  12.   set %x #CHARPOSX / 8
  13.   if #CHARPOSX > ( %x  * 8 )
  14.    {
  15.     event sysmessage X Not on the grid.
  16.     wait 10
  17.     gosub ToGrid
  18.    }
  19.   set %y N/A
  20.   set %y #CHARPOSY / 8
  21.   if #CHARPOSY > ( %y  * 8 )
  22.    {
  23.     event sysmessage Y Not on the grid.
  24.     wait 10
  25.     gosub ToGrid
  26.    }
  27.   else
  28.       event sysmessage On the spot.$
  29.       gosub DigTop
  30.  }
  31. sub DigTop
  32.  {
  33.   repeat   ;; dig top
  34.    {
  35.     event sysmessage digging top
  36.     key 8
  37.     wait 20
  38.     set %TopX  #CHARPOSX - 1
  39.     set %TopY  #CHARPOSY - 1
  40.     set #LTargetX %TopX
  41.     set #LTargetY %TopY
  42.     set #LTargetZ 0
  43.     event macro 22 0
  44.     wait 10
  45.     scanjournal 1
  46.     if no_metal in #journal
  47.      set %check 1
  48.    }
  49.   until %check = 1
  50.    event sysmessage Top Depleted.
  51.    set %check 0
  52.    gosub DigBot
  53.  }
  54. sub DigBot
  55.  {
  56.   repeat   ;; dig Bot
  57.    {
  58.     event sysmessage digging bot
  59.     key 8
  60.     wait 20
  61.     set %BotX  #CHARPOSX + 1
  62.     set %BotY  #CHARPOSY + 1
  63.     set #LTargetX %BotX
  64.     set #LTargetY %BotY
  65.     set #LTargetZ 0
  66.     event macro 22 0
  67.     wait 10
  68.     scanjournal 1
  69.     if no_metal in #journal
  70.      set %check 1
  71.    }
  72.    until %check = 1
  73.     event sysmessage Bot Depleted.
  74.     set %check 0
  75.     gosub DigLeft
  76.  }
  77. sub DigLeft
  78.  {
  79.   repeat   ;; dig Left
  80.    {
  81.     event sysmessage digging left
  82.     key 8
  83.     wait 20
  84.     set %LeftX #CHARPOSX - 1
  85.     set %LeftY #CHARPOSY + 1
  86.     set #LTargetX %LeftX
  87.     set #LTargetY %LeftY
  88.     set #LTargetZ 0
  89.     event macro 22 0
  90.     wait 10
  91.     scanjournal 1
  92.     if no_metal in #journal
  93.      set %check 1
  94.    }
  95.    until %check = 1
  96.     event sysmessage Left Depleted.
  97.     set %check 0
  98.     gosub DigRight
  99.   }
  100. sub DigRight
  101.  {
  102.   repeat   ;; dig Right
  103.     {
  104.     event sysmessage digging Right
  105.     key 8
  106.     wait 20
  107.     set %RightX #CHARPOSX + 1
  108.     set %RightY #CHARPOSY - 1
  109.     set #LTargetX %RightX
  110.     set #LTargetY %RightY
  111.     set #LTargetZ 0
  112.     event macro 22 0
  113.     wait 10
  114.     scanjournal 1
  115.     if no_metal in #journal
  116.      set %check 1
  117.    }
  118.    until %check = 1
  119.     event sysmessage Right Depleted.
  120.     set %check 0
  121.     event sysmessage completed.
  122.     gosub WhatNext
  123.  }
  124. sub WhatNext
  125.  {
  126.   display yesnocancel What to do next? $ Yes : continue to mine $ No : Move ores to packhorse $ Cancel : Find a forge and smelt $
  127.    if #dispres = yes
  128.      gosub starting
  129.  
  130.    if #dispres = no
  131.  
  132.      execute easyuo.exe OreToPackhorse.txt
  133.  
  134.    if #dispres = cancel
  135.     execute easyuo.exe ForgeSmelt.txt
  136.  
  137.     stop
  138.   }
  139.    
  140.  
  141.  
  142.  
  143.  


Top
  Profile 
PostPosted: Mon Nov 19, 2018 6:48 am 
Offline
Adept Scripter
Adept Scripter

Joined: 04/14/2007 16:18
Posts: 148

Groups:
Why not use call instead of execute easyuo.exe?

Gaderian


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Mon Nov 19, 2018 7:47 am 
Offline
Administrator
Administrator
User avatar

Joined: 08/12/2003 07:28
Posts: 19007
Location: Switzerland

1.: Quote-Tags != Code-tags ;) I changed that for you
2.: Oh the horror! http://wiki.easyuo.com/index.php?title=Call please!!! :D

_________________
EUO Member and postwhore since: 19th Dezember, 2002; Loosing on freeshard Alexandria since: 5th January, 2005
Searches cure for cancer since: 17th November, 2003 on GRID.org & Worldcommunitygrid.org
Made scripts for Project 'Programmers for Alexandria' worth 50$
Image
Quote "mmorning": Where would theses boards be if Orn didn't miss all the sarcasm. Man its great having him here :)
Quote "author-unknown": Good idea. I gotta start doing that too. You're a trendsetter Orn. :)
Quote "dreyfus": #true is always #true


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Mon Nov 19, 2018 8:45 am 
Offline
Script Kiddie
Script Kiddie

Joined: 10/09/2018 15:17
Posts: 8
So, you guys have no idea about why this problem happens either?
Isn't it supposed to work with execute command too anyway?


Top
  Profile 
PostPosted: Mon Nov 19, 2018 9:50 am 
Offline
Script Kiddie
Script Kiddie

Joined: 10/09/2018 15:17
Posts: 8
well, got it worked with call. thanks.
But if you know why it didn't work with execute please let me know.


Top
  Profile 
PostPosted: Mon Nov 19, 2018 11:32 am 
Offline
Administrator
Administrator
User avatar

Joined: 08/12/2003 07:28
Posts: 19007
Location: Switzerland

I never looked at the code of EUO, but as EUO hooks itself into UO, there can be problems if you try to double-hook to UO...
But honestly, thats a question to a problem with an action never intended.
Thats why we have call and multiple scripts per EUO-instance. No need for multiple EUO's

_________________
EUO Member and postwhore since: 19th Dezember, 2002; Loosing on freeshard Alexandria since: 5th January, 2005
Searches cure for cancer since: 17th November, 2003 on GRID.org & Worldcommunitygrid.org
Made scripts for Project 'Programmers for Alexandria' worth 50$
Image
Quote "mmorning": Where would theses boards be if Orn didn't miss all the sarcasm. Man its great having him here :)
Quote "author-unknown": Good idea. I gotta start doing that too. You're a trendsetter Orn. :)
Quote "dreyfus": #true is always #true


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Mon Nov 19, 2018 11:58 am 
Offline
Adept Scripter
Adept Scripter

Joined: 04/14/2007 16:18
Posts: 148

Groups:
From a security standpoint I am extremely careful what I would allow for execute.

CALL is the correct statement in this instance, so there is no reason to debug how to get this to work with execute.

You questioned what you were missing or what was wrong: I am pretty confident it is fixed since you said the call statement worked for you. :)

Gaderian


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Mon Nov 19, 2018 10:49 pm 
Offline
Administrator
Administrator
User avatar

Joined: 08/12/2003 07:28
Posts: 19007
Location: Switzerland

... but check your sub-structure and the use of sub and gosub!
They are MESSED UP...
See viewtopic.php?p=434970#p434970

_________________
EUO Member and postwhore since: 19th Dezember, 2002; Loosing on freeshard Alexandria since: 5th January, 2005
Searches cure for cancer since: 17th November, 2003 on GRID.org & Worldcommunitygrid.org
Made scripts for Project 'Programmers for Alexandria' worth 50$
Image
Quote "mmorning": Where would theses boards be if Orn didn't miss all the sarcasm. Man its great having him here :)
Quote "author-unknown": Good idea. I gotta start doing that too. You're a trendsetter Orn. :)
Quote "dreyfus": #true is always #true


Top
  ProfileShow poster's scripts in the public script library 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Hosted by CalWeb Internet Services, Inc.