Total players online: 6



Take the Tour | Site Map

It is currently Sun Dec 09, 2018 10:35 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Mon Aug 06, 2018 8:12 am 
Offline
Script Kiddie
Script Kiddie

Joined: 07/29/2018 14:26
Posts: 8
Sorry not sure where to post this I need help ASAP, will delete this second someone PM me! :D
:alien: :alien: :bounce:


Top
  Profile 
PostPosted: Mon Aug 06, 2018 8:27 am 
Offline
Administrator
Administrator
User avatar

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

pmed you... but please: we wont support illegal scripts. therefore i would like to fullfill your support-request in a normal thread and not via pm. did that once: was too cumbersome with pms...

_________________
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 Aug 06, 2018 7:00 pm 
Offline
Script Kiddie
Script Kiddie

Joined: 07/29/2018 14:26
Posts: 8
Not illegal just someone else's script dont wanna post public without asking them first.
It is a lumberjack script and for some reason it runs but not officiant at all it always tries to hack at a tree while still having making it start over.. or runs away while still hacking tree... maybe u could leave me ur email in PM and I could send u to have a look over and maybe u could see why? I'm decent with easyuo studies lots and made some easy scripts way back but I cant figure this out :(


Top
  Profile 
PostPosted: Mon Aug 06, 2018 8:18 pm 
Offline
Administrator
Administrator
User avatar

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

Is the script from here? Just post a link to the script...
I will NOT go thru the hole crap with PMs and eMail and ICQ and AIM and so on... I will help you if we can do it in a thread. If we cannot do it in a thread: Look for someone else.

So:
- See that the thing is somewhere here in the boards officially
- Post a link to the script.

_________________
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: Fri Aug 10, 2018 5:54 am 
Offline
Administrator
Administrator
User avatar

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

Looks it wasnt this urgent after all, eh?

_________________
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 Aug 13, 2018 12:53 pm 
Offline
Script Scribe
Script Scribe

Joined: 10/04/2014 13:40
Posts: 96
Probably not, considering EUO has been down a couple of weeks so he/she can't test it anyway.

Wow just released a new expansion too, goes live in an hour, which always seems to cause some to leave.


Top
  Profile 
PostPosted: Tue Aug 14, 2018 3:15 am 
Offline
Administrator
Administrator
User avatar

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

EasyUO wasnt down... There were indipendent builds...

_________________
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: Tue Aug 14, 2018 10:08 am 
Offline
Developer
Developer
User avatar

Joined: 06/29/2003 11:05
Posts: 2458

Maybe the last build still works, ever considered that? :roll:


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Wed Aug 15, 2018 6:01 pm 
Offline
Legendary Scripter
Legendary Scripter

Joined: 01/07/2008 12:51
Posts: 1697
Location: Kelowna, BC

Cheffe wrote:
Maybe the last build still works, ever considered that? :roll:


Sneaky Cheffe :D

_________________
Sig.


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Sun Aug 26, 2018 5:42 pm 
Offline
Script Kiddie
Script Kiddie

Joined: 07/29/2018 14:26
Posts: 8
had family emergency which was more important than easyuo scripting sorry ;P
back to normal for now though... hoping to figure this out still.
this script is from unseen macro pack which he released here on forum.
it is lumberjack script, I am having 2 problem. 1. I need add sub to check my backpack and if not there then take 8 hatchets from a bag inside my bankbox and drop them in my backpack while doing my bank run with the logs same time I charge up runebook before I return to chopping. 2. for recalling the 4 sets of numbers after the word recall... for the first and second set of numbers on recalling.. the first one is position of my runebook and the second set is x and y of the rune button I want to press location right? or how do I edit that proper.. that's what ive been trying so far..
I have most of it working nice and smooth, just need to be able to add hatchets and know how to set the recalling proper. I have a miner version I used pieecs from this for and works nice but i dont recall I just use walk commands because ive been too newbie for recalling until now, #levelup 2019 easyuo helppppp please :)))


heres the script;

Code:
  1.  
  2. Set %RuneBookID PAOUJMD
  3. Set %BankID ATKXJMD
  4. Set %Rune 1
  5. Gosub SetBackPackID
  6.  
  7. Sub SetBackPackID
  8. Wait 1s
  9. Set %BackPackID #ContID
  10.  
  11. tile init noOverrides
  12.  
  13.  
  14. ;pega no machado take the axe
  15. finditem FSF_ASF
  16.  
  17. inicio:
  18. ;dimensao do quadrado a pesquisar dimension of square
  19. set %xi #charposx - 35
  20. set %yi #charposy - 35
  21. set %xf #charposx + 35
  22. set %yf #charposy + 35
  23. set %cnt 0
  24.  
  25. set #lpc 1000 ;speedup calcs
  26.  
  27. ;detectar arvores detect trees
  28. for %y %yi %yf
  29. {
  30.         for %x %xi %xf
  31.         {
  32.                 tile get %x %y 3
  33.                 if ( #tiletype >= 3277 && #tiletype <= 3302 )
  34.                 {
  35.                         set %cnt %cnt + 1
  36.                         set %treex . %cnt %x
  37.                         set %treey . %cnt %y
  38.                         set %treez . %cnt #tilez
  39.                         set %tile . %cnt #tiletype
  40. ;                       set %tilename . %cnt #tilename
  41.                         skip:
  42.                 }
  43.         if %cnt > 50
  44.         {
  45.                 goto maisnaum
  46.         }
  47.         }
  48. }
  49.  
  50. maisnaum:
  51.  
  52. ;ordenar por arvore mais proxima order by nearest tree
  53. set %cuposx #charposx
  54. set %cuposy #charposy
  55. for %y 1 %cnt
  56. {
  57. set %sd 30000
  58.         for %x 1 %cnt ;encontra o mais pequeno finds the smallest
  59.         {
  60.                 set %tempx %cuposx  - %treex . %x abs
  61.                 set %tempy  %cuposy - %treey . %x abs
  62.                 set %temp %tempx + %tempy
  63.                 if %temp < %sd
  64.                 {
  65.                         set %sd %temp
  66.                         set %spos %x
  67.                 }
  68.         }
  69.  
  70.         ;passa o mais pequeno para a tabela temporaria
  71.         set %temptreex . %y %treex . %spos
  72.         set %temptreey . %y %treey . %spos
  73.         set %temptile . %y %tile . %spos
  74.         set %temptreez . %y %treez . %spos
  75.         set %cuposx %treex . %spos
  76.         set %cuposy %treey . %spos
  77.         set %treex . %spos 30000
  78.         set %treey . %spos 30000
  79.  }
  80.  
  81. ;repoe a tabela tree
  82. for %y 1 %cnt
  83. {
  84.         set %treex . %y %temptreex . %y
  85.         set %treey . %y %temptreey . %y
  86.         set %tile . %y %temptile . %y
  87.         set %treez . %y %temptreez . %y
  88. }
  89.  
  90. set %esp 0
  91.  
  92. for %x 1 %cnt
  93. {
  94.         set %a %treex . %x
  95.         set %b %treey . %x
  96.         set %c %tile . %x
  97.         set %d %treez . %x
  98.         move %a %b 1 15s
  99.         wait 5
  100.  
  101.         ;detecta se ficou muito longe detects if u stayed too far
  102.         set %dx #charposx - %a abs
  103.         set %dy  #charposy - %b abs
  104.         set %df %dx + %dy
  105.         if %df > 7
  106.         {
  107.                 goto fimjacka
  108.         }
  109.  
  110.         set #ltargetx %a
  111.         set #ltargety %b
  112.         set #ltargetz %d
  113.         set #ltargetkind 3
  114.         set #ltargettile %c
  115.         lumberjacka:
  116. finditem FSF_ASF
  117.         set %esp 0
  118.         event macro 17
  119.         target 5
  120.         event macro 22
  121.         espera:
  122.         if #contkind = ECTB
  123.         goto login
  124.         if #charghost = yes
  125.         goto homehomehome
  126.         scanjournal 1
  127.         if YOU_HACK_AT_THE in #journal
  128.                 goto lumberjacka
  129.         if YOU_PUT_THE in #journal
  130.                 goto lumberjacka
  131.         if YOUR_SKILL_IN in #journal
  132.                 goto lumberjacka
  133.         if THERE_IS_NOTHING_HERE in #journal
  134.                 goto fimjacka
  135.         if THAT_IS_TOO_FAR in #journal
  136.                 goto fimjacka
  137.         if IT_APPEARS_IMMUNE in #journal
  138.                 goto fimjacka
  139.         if YOU_CAN'T_REACH in #journal
  140.                 goto fimjacka
  141.         if %esp < 80 ; increase to 80 if you have low lumberjack skill
  142.         {
  143.                 set %esp %esp + 1
  144.                 wait 1
  145.                 goto espera
  146.         }
  147.         goto lumberjacka
  148.         fimjacka:
  149.         if #weight > 510 1
  150.         goto bank
  151.         if #contkind = ECTB
  152.         goto login
  153.         if #charghost = yes
  154.         goto homehomehome
  155.         set %esp 0
  156. }
  157. goto inicio:
  158.  
  159. bank:
  160. ;Gosub Recall 260 275 1007 1653 %RuneBookID
  161. Gosub Recall 260 275 89 131 %RuneBookID
  162. FindItem ZLK C_
  163. Event Drag #FindID
  164. Wait 10
  165. Msg $
  166. Wait 10
  167. Click 363 212
  168. Goto TakeScroll
  169.  
  170. TakeScroll:
  171. Move 1007 1652 0
  172. Msg bank$
  173. Wait 1s
  174. If #ContKind <> ASEB
  175. Goto TakeScroll
  176. Goto Recharge
  177.  
  178. Recharge:
  179. Contpos 0 0
  180. FindItem WTL C_ , %BankID
  181. Event Drag #FindID
  182. Wait 10
  183. Msg 1$
  184. Wait 10
  185. Set #FindMod 20_10
  186. FindItem %RuneBookID C_ , %BackPackID
  187. Click #FindX #FindY p
  188. FindItem WTL C_ , %BankID
  189. Event Drag #FindID
  190. Wait 10
  191. Msg 1$
  192. Wait 10
  193. FindItem %RuneBookID C_ , %BackPackID
  194. Click #FindX #FindY p
  195. Set #FindMod 0_0
  196. Set %Rune %Rune + 1
  197. If %Rune >= 6
  198. Set %Rune 1
  199. If %Rune = 1
  200. Gosub Recall 5141 1074 113 81 %RuneBookID
  201. If %Rune = 2
  202. Gosub Recall 260 305 1624 1376 %RuneBookID
  203. If %Rune = 3
  204. Gosub Recall 260 320 1026 1718 %RuneBookID
  205. If %Rune = 4
  206. Gosub Recall 260 335 1678 1294 %RuneBookID
  207. If %Rune = 5
  208. Gosub Recall 260 350 1003 1456 %RuneBookID
  209. Goto inicio
  210.  
  211. Sub Recall
  212. Recalling:
  213. Set #LObjectID %5
  214. Event Macro 17 0
  215. Wait 2s
  216. If #ContKind <> UCHB
  217. {
  218.         Wait 2s
  219.         Click 260 260 r
  220.         Goto Recalling
  221. }
  222. Click %1 %2
  223. Wait 7s
  224. If ( #CharPosX <> %3 ) && ( #CharPoxY <> %4 )
  225. Goto Recalling
  226. IgnoreItem Reset
  227. Return
  228.  
  229. login:
  230. Wait 3s
  231. Click 325 270
  232. Wait 3s
  233. Click 325 270
  234. Wait 3s
  235. Click 325 270
  236. Wait 300s
  237. Click 372 397
  238. Wait 10s
  239. Msg password$
  240. Wait 60s
  241. Click 195 430
  242. Wait 60s
  243. Click 363 166 d
  244. Wait 60s
  245. If #CharName = N/A
  246. {
  247.         Click 323 315
  248.         Wait 10s
  249.         For %LoginLoop 0 15
  250.         {
  251.                 Wait 10
  252.                 Key back
  253.         }
  254.         Goto Login
  255. }
  256. Wait 60s
  257. Click 166 166 r
  258. Event Macro 8 1
  259. Wait 1s
  260. ContPos 770 22
  261. Event Macro 8 2
  262. Wait 1s
  263. ContPos 781 384
  264. Event Macro 8 7
  265. Wait 1s
  266. ContPos 396 568
  267. Set %rune 1
  268. Gosub Recall 260 290 853 1791 %RuneBookID
  269. goto inicio
  270.  
  271. HomeHomeHome:
  272. If #ContKind = ETCB
  273. Goto Login
  274. Msg
  275. Wait 2s
  276. Msg $
  277. Wait 5s
  278. If ( #CharPosX <> 5182 ) && ( #CharPosY <> 1259 )
  279. {
  280.         Goto HomeHomeHome
  281. }
  282. Move 5146 1077 0
  283. Move 5142 1074 0
  284. Goto Resurrection
  285.  
  286. Resurrection:
  287. If #ContKind = ETCB
  288. Goto Login
  289. Set #LObjectID GSYSJMD
  290. Wait 30s
  291. Event Macro 17 0
  292. Click 72 100
  293. Wait 5s
  294. If #CharGhost = Yes
  295. {
  296.         Goto HomeHomeHome
  297. }
  298. Goto Open
  299.  
  300. Open:
  301. Event Macro 8 1
  302. Wait 1s
  303. Contpos 770 22
  304. event macro 8 2
  305. Wait 1s
  306. Contpos 781 384
  307. event macro 8 7
  308. Wait 1s
  309. Contpos 396 568
  310. Goto Scroll
  311.  
  312. Scroll:
  313. Set #LObjectID VERYJMD
  314. Event Macro 17
  315. Wait 2s
  316. If #ContKind <> UCHB
  317. Goto Scroll
  318. Click 252 117
  319. Wait 2s
  320. If #ContKind <> ASEB
  321. Goto Scroll
  322. Goto Charge
  323.  
  324. Charge:
  325. Contpos 0 0
  326. FindItem WTL C _ , %BankID
  327. Event Drag #FindID
  328. Wait 10
  329. Msg 1$
  330. Wait 10
  331. Set #FindMod 20_10
  332. FindItem %RuneBookID C_ , %BackPackID
  333. Click #FindX #FindY p
  334. Set #FindMod 0_0
  335. Set %Rune 1
  336. Gosub Recall 260 290 853 1791 %RuneBookID
  337. Goto inicio
  338.  


Top
  Profile 
PostPosted: Sun Aug 26, 2018 9:26 pm 
Offline
Script Scribe
Script Scribe

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

Groups:
Hi,
Please use code tags (using the 'full editor' button when you are creating your post) around code, because it makes it easier to read.

As for recalling and using runebooks, there are several routines people have posted publicly to share how to access a runebook in a set of routines. I can try to look up one or two that are fairly simple to implement tomorrow.

So as I tried to run it, it never found any tile locations. So I made modifications as follows to locate the tiles to attempt to chop.

Think of the tiles as a stack of plates, where each one will have different information on it. We need to check each plate in the stack. The stack of tiles at a given location can vary, so it will not always be 3 (in your original example). Part of the stack in the woods includes the forest floor, the tree trunk, the leaves of the tree. This allows the UOclient's 'circle of transparency' option to turn off the leaves, or maybe the tree trunk, but we will always see the forest floor.

Your routine for examining the tiles, looks at the tile 3 (if it even exists???) at the x/y location. You will actually want to cycle through any tiles that are on that x/y location to search for 'choppable' tiles. Without this cycle routine, I never get the tile data updated. So for starters, consider trying to revise the routine to look similar to:
Code:
  1.  for %x %xi %xf
  2.   {
  3.   tile cnt %x %y ; how many tiles are 'stacked' at this x/y location
  4.   for %g_tilecnt 1 #tilecnt ; cycle through the tiles in the stack
  5.    {
  6.   tile get %x %y %g_tilecnt ; 3 ; instead of hard coding the 3rd tile, use the variable to allow cycling through the stack of tiles
  7.   if  ( #tiletype >= 3277 && #tiletype <= 3302 ) ; if TREE in #tilename
  8.    {
  9.    set %cnt %cnt + 1
  10.    set %treex . %cnt %x
  11.    set %treey . %cnt %y
  12.    set %treez . %cnt #tilez
  13.    set %tile . %cnt #tiletype
  14.    ; set %tilename . %cnt #tilename
  15.    skip:
  16.    }
  17.    } ; end for loop - not sure this is the correct location logically to close the for loop, but at a quick glance it looked reasonable
  18.  


With that logical addition, I can now see the tile data as I step (F7) through the script. I will assume that your tiletype numbers are correct, but I was looking at the tilename to contain 'tree' as a keyword - which I left commented out.

To make this a cleaner script, you may wish to setup at a starting location. If it is at the bank, open the bank and choose a container to store your gathered resources (logs/boards, etc.). This way you can make a drag/drop routine to hold your items which will auto stack inside that container when you drop it onto that container. If everything is simply in your bank box main level, then the code is more complicated to try to stack like items.
Gaderian


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Mon Aug 27, 2018 7:32 pm 
Offline
Script Kiddie
Script Kiddie

Joined: 07/29/2018 14:26
Posts: 8
There is already a recall sub in the script .... I was asking what the 4 numbers represented and if I was trying to edit them correct or not.. the first 2 I thought were book location/coords the second 2 numbers I thought were coords for the botton coords which I want to recall from...

The script works fine as is and finds and chops for me as it is now.. I just need to add a sub to restock hatchets each time it banks or res and to understand to set the recall numbers.

In the runebook it is first rune Bank.. then 4 runes of 4 different start locations... each time u bank u go next location

I know how to edit most of it just need know these 2 thing


Top
  Profile 
PostPosted: Mon Aug 27, 2018 9:59 pm 
Offline
Script Scribe
Script Scribe

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

Groups:
I am going to assume you copied this Recall sub from another script and other than the modification of the first gosub into the routine for the first tree location, you haven't modified the 'gosub recall' lines - because they seem reasonable to work with the routine itself.

So taking a snippet of code out of the script, here are some of the uses of the Recall subroutine, then the routine itself for reference:
Code:
  1. FindItem %RuneBookID C_ , %BackPackID
  2. Set %Rune %Rune + 1
  3. If %Rune >= 6
  4. Set %Rune 1
  5. If %Rune = 1
  6. Gosub Recall 5141 1074 113 81 %RuneBookID
  7. If %Rune = 2
  8. Gosub Recall 260 305 1624 1376 %RuneBookID
  9. If %Rune = 3
  10. Gosub Recall 260 320 1026 1718 %RuneBookID
  11. If %Rune = 4
  12. Gosub Recall 260 335 1678 1294 %RuneBookID
  13. If %Rune = 5
  14. Gosub Recall 260 350 1003 1456 %RuneBookID
  15. Goto inicio
  16.  
  17. Sub Recall
  18. Recalling:
  19. Set #LObjectID %5 ; this is the 5th parameter passed into the sub - %RuneBookID above
  20. Wait 2s
  21. If #ContKind <> UCHB
  22. {
  23.         Wait 2s
  24.         Click 260 260 r ; we have the incorrect #ContKind so close this gump by right clicking on it (assuming it exists at screen positions x/y 260/260
  25.         Goto Recalling
  26. }
  27. Click %1 %2 ; this clicks the first 2 passed parameters as x/y and actually chooses the spot to click on the gump
  28. Wait 7s
  29. If ( #CharPosX <> %3 ) && ( #CharPoxY <> %4 ) ; this does a force check to recall again if the avatar has not arrived at the coordinates passed into the routine as parameters 3 and 4
  30. Goto Recalling


I made comments to show where the action happens against the various parameters passed into the routine.

Most of the time, it is good practice to code more generic routines - which is my defense for my previous answer (this code doesn't function on OSI at generic tree locations to chop - and I just won't go make a character to work up enough skill to craft runebooks and magery to go mark runes to test this code on some freeshard).

This recall routine expects the runebook to open in the exact location each time. By passing the first 2 parameters for x and y, these become hard coded screen locations to click. If you run a windowed UO client so the world exists in a gump and you can have gumps outside the world (in the black space most of us use to place the radar map, paperdoll, status gump (without which many Easyuo variables like your name and weight do not update)), then these fixed screen locations to click on become unreliable.

The more standard method to create a click routine is to establish relative click locations based on offsets for #CONTPOSX and #CONTPOSY. It is also possible to create more readable code so you can pass in a rune number you want to choose into the runebook accessing routine and calculate the relative offset.

So, the click location is at 260, 305 for the rune # 2 (I am ignoring rune #1 because it is way out at 5000+/1000+ pixels and my screen resolution is < 1500x1200 so that click location is way off. My guess would be that the numbers for parameters 1-4 on that call have been exchanged (1 and 2 for 3 and 4, respectively) and the values for 1 and 2 initially were 260 and 290.

The size of the gump that makes a runebook on OSI is currently 452x236 for x and y sizes (when the gump is selected, the #CONTSIZEX and #CONTSIZEY show these values for the gump). This makes the pixel location for Y clearly hard coded on the screen position for where it expects the runebook to show up each time, or your runebook gump size is *much* larger than the OSI size. For these click locations to be valid, the runebook must open to the exact same location on screen each time. On OSI a runebook gump can be moved and the next time it is opened, it will open in that same location. This makes sense why those locations could have been assumed never to change, but if you move the runebook gump, it will break this code until the runebook is placed back in nearly the original location on screen.

That last sentence may be the reason you are experiencing difficulty with this recall routine.
The most resilient correction is what I explained above, make the click locations relative to the runebook gump location.

If you do not want to revamp the code (other than the Gosub Recall to the first rune, because clearly it won't work with the other rune locations), then you could move your runebook gump until it's #CONTPOSX = 126 and #CONTPOSY = 205. Then correct the rune #1 (for tree rune, this is the 2nd rune in the runebook since the bank is the first one) statement to become:
  1.  gosub Recall 260 290 5141 1074 %RuneBookID
Of course, if you *ever* drag the rune book to another screen location for this character, you will need to drag it back into this place to get this script to function once again.

Now, if you desire a more resilient Recall subroutine, consider the following offsets (on OSI - possibly not on your freeshard for the x-click location, while your y-click location seems to match OSI):
Runes 1-8 have an X offset (#CONTPOSX + 134) of 134.
Runes 9-16 have an X offset (#CONTPOSX + 294) of 294.
Runes 1/9 have a Y offset (#CONTPOSY + 70) of 70 and each row (2/10, 3/11, ... 8/16) are incremented by 15. These run from 70 to 175. A clever way to do that would be to have the algebraic, not Easyuo, formula:
  1. y_click = ( 1 + ( rune_number % 8 ) ) * 15 + 55


Finally, whatever method you choose to follow, you will need to recall to each of your locations and verify that the #CHARPOSX and #CHARPOSY values for your destination match the code passed on each
  1. Gosub Recall ...


If this were my script, I would probably make it called as follows:
  1. Gosub Recall %rune %runebookid %destinationx %destinationy
and then within the Recall sub, I would make parameters 3 and 4 optional.
When you call a sub, you get these variables to reference:
  1. ; parameter values in a subroutine
  2. ; %0 = how many parameters were passed
  3. ; %1 = first parameter passed
  4. ; %2 = second parameter passed
  5.  ...
  6. ; %n = nth parameter passed

Now if a subroutine is called and passed 10 parameters, then calls another subroutine within it, these parameter values get overwritten, so it is good practice to save them at the start of the subroutine. These parameters do not get reset, so if the next gosub only passes 2 parameters, the parameters 3-10 will still have values, so at the start of a routine that uses optional parameters at the end of it's call list, verify the validity of the parameters passed by checking how many parameters were passed in variable %0. So here is a short example of how that could be done:
  1. ; this routine MySub has 2 required parameters and 2 optional parameters
  2. ; gosub MySub [rune number] [runebookid] [[destination charposx location] [destination charposy location]]
  3. sub MySub
  4.  set %destination #false
  5.  if %0 > 1
  6.   {
  7.   set %local_rune %1
  8.   set %local_book %2
  9.   if %0 = 4
  10.    {
  11.    set %local_startx #charposx
  12.    set %local_starty #charposy
  13.    set %local_x %3
  14.    set %local_y %4
  15.    set %destination #true
  16.    }
  17.  }
  18. Recall_start:
  19.  ; now open the runebook and save it's #CONTPOSX and #CONTPOSY
  20.  ; calculate the offsets for the rune location
  21.  ; execute the click
  22.  if %destination
  23.   {
  24.   set %local_wait_limit #scnt2 + 100 ; 10 second wait in tenths of seconds
  25.    wait 1 ; wait a short time for location to arrive at the %local_x and %local_y locations
  26.   until #charposx <> %local_startx || #charposy <> %local_starty || %local_wait_limit < #scnt2
  27.  
  28.   if #charposx <> %local_x || #charposy <> %local_y   ; if the location hasn't changed to the locations, try again
  29.    goto recall_start
  30.   }


That would make a more resilient recall sub. I left comments to show what you would do without the details of coding it in this simple model routine. I would probably make an optional parameter out of the wait time until the location changes. The analysis of the original Recall sub and even the one I have modeled from it above have an issue where if the locations are not correct on the destination, it becomes an infinite loop - never a good thing. :wink: I would also just make it show that my #charposx/#charposy have changed rather than finding the destination locations and hard coding these into a script. That would allow whatever location I want in my runebook to not require a change to the script based on the order of the runes in the book.

As your scripting skill becomes more sophisticated, you could get into namespace commands. Namespaces clean up variable names so these do not conflict with script variables and become valuable on utility routines like a travel subroutine.

Hopefully this makes the recall sub in your script more clear on how you can proceed.
Gaderian


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Mon Aug 27, 2018 11:26 pm 
Offline
Script Scribe
Script Scribe

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

Groups:
I did not see any code in the script that attempts to get more axes from the bank. Am I missing something or do you have something that just isn't working?

Gaderian


Top
  ProfileShow poster's scripts in the public script library 
PostPosted: Tue Aug 28, 2018 5:36 am 
Offline
Script Kiddie
Script Kiddie

Joined: 07/29/2018 14:26
Posts: 8
Thank you so much for all the help and explanations. So I was right in thinking the first 2 runebook numbers are the cont x and y and the second 2 numbers the button of the rune. Do you have Skype and its be easier for us to talk about this? I'm just at work atm.


Top
  Profile 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 21 posts ]  Go to page 1, 2  Next

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 18 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.