Total players online: 14



Take the Tour | Site Map

It is currently Sun Dec 10, 2017 11:21 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 9 posts ] 
Author Message
Jason Roman
PostPosted: Sun Oct 25, 2009 6:25 pm 
To surround the character with said items in a closed circle


Top
   
PostPosted: Sun Oct 25, 2009 8:23 pm 
Offline
Apprentice Scripter
Apprentice Scripter

Joined: 06/16/2008 13:52
Posts: 17

Groups:
Here's a snippet that will find shovels in your backpacks and place them beside your character. You just need to write the sub so that you hit all 9 points.

Code:
  1.  
  2. set %loopcounter 0
  3. set %stoppoint 9
  4.  
  5. beginloop:
  6.  
  7. {
  8.  wait 10
  9.  ;replace this with a sub to use loopcounter
  10.  ;to figure out the x/y coords
  11.  ;begin replace block
  12.  set %x #charposx + 1
  13.  set %y #charposy + 1
  14.  ;end replace block
  15. }
  16.  
  17. set %loopcounter %loopcounter + 1
  18.  
  19. if %loopcounter > %stoppoint
  20.    halt
  21.  
  22. goto beginloop
[/code]


Top
  Profile 
Jason Roman
PostPosted: Mon Oct 26, 2009 8:58 am 
How is it

  1.  
  2. set %loopcounter 0
  3. set %stoppoint 9
  4.  
  5. beginloop:
  6.  
  7. {
  8.  wait 10
  9.  set %x #charposx + 1
  10.  set %y #charposy + 1
  11. }
  12.  
  13. set %loopcounter %loopcounter + 1
  14.  
  15. if %loopcounter > %stoppoint
  16.    halt
  17.  
  18. goto beginloop


Top
   
PostPosted: Mon Oct 26, 2009 9:10 am 
Offline
Apprentice Scripter
Apprentice Scripter

Joined: 06/16/2008 13:52
Posts: 17

Groups:
It is not.

The comments in the code as well as the text in my post indicated that you had to do a little bit of the work yourself.

I've given you what you need to succeed, if you want a full script to drop items all around you, perhaps you need to go to the script request forum.


Top
  Profile 
PostPosted: Mon Oct 26, 2009 9:42 am 
Offline
Apprentice Scripter
Apprentice Scripter

Joined: 06/16/2008 13:52
Posts: 17

Groups:
You're PM to me was rather polite, so I'll continue for a bit

Code:
  1.  
  2. set %loopcounter 0
  3. set %stoppoint 8
  4.  
  5. beginloop:
  6.  
  7. if #findkind <> -1
  8. {
  9.  wait 10
  10.  gosub setxy %loopcounter
  11.  exevent dropg %x %y
  12. }
  13.  
  14. set %loopcounter %loopcounter + 1
  15.  
  16. if %loopcounter > %stoppoint
  17.    halt
  18.  
  19. goto beginloop
  20.  
  21. sub setxy
  22. {
  23.  if %1 = 0
  24.  {
  25.   set %x #charposx
  26.  }
  27.  if %1 = 1
  28.  {
  29.   set %x #charposx + 1
  30.   set %y #charposy + 1
  31.  }
  32.  if %1 = 2
  33.  {
  34.   set %x #charposx - 1
  35.   set %y #charposy - 1
  36.  }
  37.  if %1 = 3
  38.  {
  39.   set %x #charposx + 1
  40.   set %y #charposy - 1
  41.  }
  42.  ;you'll need to keep going until you hit all 8 possibilities
  43. }


Top
  Profile 
Jason Roman
PostPosted: Mon Oct 26, 2009 1:21 pm 
Interesting phenomenon occurred, adjusting the first line to
finditem CUD_ , #backpackid
caused my character to drop its own backpack, then my character had no backpack until I replaced it. I tried it with a different character and the backpack couldn't be moved
Needs to drop 1 item per tile and not same item for all
Running the macro properly caused it to drop in the following order
1 is character's tile

2 5
4 1
3

then it stops, hitting play again will drop the item on the character's tile and proceed to the remaining 4 and sometimes it will stop 1 second after hitting play or repeat dropping to the first 5 tiles.
I didn't anticipate these many lines were needed, didn't mean to put a burden on you

  1.  
  2. set %loopcounter 0
  3. set %stoppoint 8
  4.  
  5. beginloop:
  6.  
  7. {
  8.  wait 10
  9.  gosub setxy %loopcounter
  10. }
  11.  
  12. set %loopcounter %loopcounter + 1
  13.  
  14. if %loopcounter > %stoppoint
  15.    halt
  16.  
  17. goto beginloop
  18.  
  19. sub setxy
  20. {
  21.  if %1 = 0
  22.  {
  23.  }
  24.  if %1 = 1
  25.  {
  26.   set %x #charposx + 1
  27.   set %y #charposy + 1
  28.  }
  29.  if %1 = 2
  30.  {
  31.   set %x #charposx - 1
  32.   set %y #charposy - 1
  33.  }
  34.  if %1 = 3
  35.  {
  36.   set %x #charposx + 1
  37.   set %y #charposy - 1
  38.  }
  39.  if %1 = 4
  40.  {
  41.   set %x #charposx - 1
  42.   set %y #charposy + 1
  43.  }
  44.  if %1 = 5
  45.  {
  46.   set %x #charposx + 1
  47.  }
  48.  if %1 = 6
  49.  {
  50.   set %x #charposx - 1
  51.  }
  52.  if %1 = 7
  53.  {
  54.   set %y #charposy + 1
  55.  }
  56.  if %1 = 8
  57.  {
  58.   set %y #charposy - 1
  59.  }
  60. }


Top
   
PostPosted: Mon Oct 26, 2009 1:41 pm 
Offline
Apprentice Scripter
Apprentice Scripter

Joined: 06/16/2008 13:52
Posts: 17

Groups:
Not sure why it quits after 5 runs (unless you run out of items of that type).

It is dropping one on your character's tile because of this statement. Probably not needed unless that is the intended affect.
  1.  
  2. if %1 = 0
  3.  {
  4.   set %x #charposx
  5.   set %y #charposy
  6.  }


If you set the loopcounter to start at 1, it should just skip over this.

If you want to drop random items, you can remove CUD and it'll drop just about anything in your pack.

If you want to drop a list of different items randomly, you can do AAA_BBB_CCC etc

I would love to know if anyone figures out the whole backpack thing.[/code]


Top
  Profile 
Jason Roman
PostPosted: Mon Oct 26, 2009 8:25 pm 
I just typed a very long and detailed message but it deleted itself when I was idle for too long and had to log in again assuming it would preserve itself, it's very inconvenient the forum doesn't preserve characters in the message field between a post and a login. I suggest the forum interface should save messages in the message field after automatic logout so someone else will not lose their message as I did.
The same item was being dragged and dropped to each tile because the initial finditem command was outside of the main loop so the #findid and #findstack values were staying applied to that item.
The script exhibits an inexplicable problem when an item type is specified in the finditem field

finditem CUD C_ , #backpackid
finditem CUD G_

it drops between 1 and 5 items and doesn't drag anymore yet if the ignoreitem #finditem field is removed the same 2 items will be grabbed and dropped in succession and otherwise work as it should. If no itemtype is specified it will work entirely without problems

finditem * C_ , #backpackid
finditem * G_

For a reason unknown to me the script is inclined to direct commands on a specific object within an array and will always grab that object, I was unable to get the ignoreitem command to stop this. I want to understand why the itemtype specification causes a malfunction but I'll take it as is. Here the only variation to suit my purpose

  1. set %loopcounter 0
  2. set %stoppoint 8
  3.  
  4. beginloop:
  5.  
  6. wait 10
  7. {
  8.  wait 10
  9.  gosub setxy %loopcounter
  10. }
  11.  
  12. set %loopcounter %loopcounter + 1
  13.  
  14. if %loopcounter > %stoppoint
  15.    halt
  16.  
  17. goto beginloop
  18.  
  19. sub setxy
  20. {
  21.  if %1 = 0
  22.  {
  23.  }
  24.  if %1 = 1
  25.  {
  26.   set %x #charposx + 1
  27.   set %y #charposy + 1
  28.  }
  29.  if %1 = 2
  30.  {
  31.   set %x #charposx - 1
  32.   set %y #charposy - 1
  33.  }
  34.  if %1 = 3
  35.  {
  36.   set %x #charposx + 1
  37.   set %y #charposy - 1
  38.  }
  39.  if %1 = 4
  40.  {
  41.   set %x #charposx - 1
  42.   set %y #charposy + 1
  43.  }
  44.  if %1 = 5
  45.  {
  46.   set %x #charposx + 1
  47.  }
  48.  if %1 = 6
  49.  {
  50.   set %x #charposx - 1
  51.  }
  52.  if %1 = 7
  53.  {
  54.   set %y #charposy + 1
  55.  }
  56.  if %1 = 8
  57.  {
  58.   set %y #charposy - 1
  59.  }
  60. }


So much thanks to mastrick for making it all possible, this is a happy ending


Top
   
PostPosted: Sun May 28, 2017 4:14 am 
Offline
Script Kiddie
Script Kiddie

Joined: 05/21/2017 02:54
Posts: 7
jesus christ u angel gods guys saved me oh ill on forever debt and ill never know how to glad really thx u the best guys i really appreciate that diamond script really appreciate that if u dont like just tell me and ill delete after banking ingots it drops ores and leave continue mining now working(droping ur trash ore tvj) :D (i was unable to make a baking loop still trying it)

a thx u letter guys (https://www.youtube.com/watch?v=zLRm2Fy4_f0)

Code:
  1. ; Mining in Delucia by Darq v0.2
  2. start_setup:
  3. set %maxspots 22
  4. move 5278 3988 0
  5. move 5243 3988 0
  6. move 5238 3983 0
  7. move 5241 3965 0
  8. jmp_startposition:
  9. move 5250 3956 0 ; startposition
  10.  
  11. ;main mining loop
  12.  
  13. for %spotcount 0 %maxspots
  14. {
  15.         finditem WTH_TWF_NPF
  16.         set #LOBJECTID #FINDID
  17.         if #FINDKIND = 0
  18.         {
  19.        
  20.                 gosub moveon
  21.                 event macro 17 0
  22.                 target
  23.                 ;dbc mining position 344 217
  24.                 click 441 314
  25.                 wait 1s
  26.                 if #WEIGHT > 560
  27.                 {
  28.                         goto donemining
  29.                 }
  30.  
  31.         }
  32. }
  33. ;main mining loop end
  34. goto jmp_startposition
  35.  
  36. ;move on
  37. sub moveon
  38. set %newx #CHARPOSX + 1
  39. move %newx #CHARPOSY 0
  40. set %spotcount %spotcount +1
  41. gosub updateweight
  42. sub updateweight
  43. ;find how much you can carry
  44. set %max %max * 35
  45. set %max %max + 400
  46. set %max %max / 10
  47.  
  48. set %heavy %max - 21
  49.  
  50. wait 1s
  51.  
  52. donemining:
  53.     ;now move to forge
  54.     set %spotcount 0
  55.     move 5246 3956 0
  56.     move 5230 3972 0
  57.     move 5246 3988 0
  58.     move 5246 4006 0
  59.     move 5236 4006 0
  60.  
  61.     ;smelt the sucker
  62.     call smelt.txt
  63.     jmp_find:
  64.     Finditem DWJ_EWJ_GWJ
  65.     if #FINDKIND = 0
  66.  
  67.             jmp_smelt:
  68.     ;       348 204
  69.             set #LOBJECTID #FINDID
  70.             event macro 17 0
  71.             target
  72.             click 419 274
  73.             wait 1s
  74.             scanjournal 1
  75.             if you_destroy_some_ore in #JOURNAL
  76.             {
  77.                     goto jmp_smelt
  78.             }
  79.             wait 2s 0
  80.             if #FINDCNT > 1
  81.             {
  82.                     goto jmp_find
  83.             }
  84.     }
  85.     ;call tinker.txt
  86.  
  87.     ;move to bank
  88.     move 5248 4006 0
  89.     move 5248 3998 0
  90.     move 5260 3990 0
  91.     move 5278 3990 0
  92.     move 5282 3990 0
  93.     move 5282 3988 0
  94.     move 5278 3984 0
  95.     move 5278 3974 0;bank wp
  96. ;put_it_in_the_bank
  97.     call bank.txt
  98. jmp_bank_start:
  99. msg Bank$
  100. wait 1s
  101. {
  102.    FINDITEM ENK ;ingots
  103.    if #FINDKIND = 0
  104.    {
  105.       if #FINDCNT > 0
  106.       {
  107.          set %findcnt #FINDCNT ; recursive? better set this
  108.          for %i 1 %findcnt
  109.          {
  110.             ;+16 +9
  111.             set %ingotx #FINDX + 16
  112.             set %ingoty #FINDY + 9
  113.             click %ingotx %ingoty g
  114.             wait 2s
  115.             msg $
  116.             FINDITEM CKF ; bag
  117.             ;+21 +9
  118.             set %distx #FINDX + 21
  119.             set %disty #FINDY + 9
  120.             click %distx %disty p
  121.             wait 1s
  122.             FINDITEM ENK ;ingots
  123.             goto jmp_bank_end
  124.                 call bank.txt
  125. jmp_bank_start:
  126. msg Bank$
  127. wait 1s
  128. {
  129.    FINDITEM ENK ;ingots
  130.    if #FINDKIND = 0
  131.    {
  132.       if #FINDCNT > 0
  133.       {
  134.          set %findcnt #FINDCNT ; recursive? better set this
  135.          for %i 1 %findcnt
  136.          {
  137.             ;+16 +9
  138.             set %ingotx #FINDX + 16
  139.             set %ingoty #FINDY + 9
  140.             click %ingotx %ingoty g
  141.             wait 2s
  142.             msg $
  143.             FINDITEM CKF ; bag
  144.             ;+21 +9
  145.             set %distx #FINDX + 21
  146.             set %disty #FINDY + 9
  147.             click %distx %disty p
  148.             wait 1s
  149.             FINDITEM ENK ;ingots
  150.             goto jmp_bank_end
  151.                 call bank.txt
  152. jmp_bank_start:
  153. msg Bank$
  154. wait 1s
  155. {
  156.    FINDITEM ENK ;ingots
  157.    if #FINDKIND = 0
  158.    {
  159.       if #FINDCNT > 0
  160.       {
  161.          set %findcnt #FINDCNT ; recursive? better set this
  162.          for %i 1 %findcnt
  163.          {
  164.             ;+16 +9
  165.             set %ingotx #FINDX + 16
  166.             set %ingoty #FINDY + 9
  167.             click %ingotx %ingoty g
  168.             wait 2s
  169.             msg $
  170.             FINDITEM CKF ; bag
  171.             ;+21 +9
  172.             set %distx #FINDX + 21
  173.             set %disty #FINDY + 9
  174.             click %distx %disty p
  175.             wait 1s
  176.             FINDITEM ENK ;ingots
  177.             goto jmp_bank_end
  178. jmp_bank_start:
  179. msg Bank$
  180. wait 1s
  181. {
  182.    FINDITEM ENK ;ingots
  183.    if #FINDKIND = 0
  184.    {
  185.       if #FINDCNT > 0
  186.       {
  187.          set %findcnt #FINDCNT ; recursive? better set this
  188.          for %i 1 %findcnt
  189.          {
  190.             ;+16 +9
  191.             set %ingotx #FINDX + 16
  192.             set %ingoty #FINDY + 9
  193.             click %ingotx %ingoty g
  194.             wait 2s
  195.             msg $
  196.             FINDITEM CKF ; bag
  197.             ;+21 +9
  198.             set %distx #FINDX + 21
  199.             set %disty #FINDY + 9
  200.             click %distx %disty p
  201.             wait 1s
  202.             FINDITEM ENK ;ingots
  203.             goto jmp_bank_end
  204.              {
  205.  
  206.  
  207.     beginloop:
  208.     set %loopcounter 0
  209.     set %stoppoint 8
  210.  
  211.     finditem tvj C_ , #backpackid
  212.     if #findkind <> -1
  213.     wait 10
  214.     {
  215.      wait 10
  216.      gosub setxy %loopcounter
  217.      exevent dropg %x %y
  218.     }
  219.  
  220.     set %loopcounter %loopcounter + 1
  221.  
  222.     if %loopcounter > %stoppoint
  223.  
  224.  
  225.     sub setxy
  226.     {
  227.      if %1 = 0
  228.      {
  229.       set %x #charposx + 1
  230.       set %y #charposy + 1
  231.      }
  232.      if %1 = 1
  233.      {
  234.       set %x #charposx + 1
  235.       set %y #charposy + 1
  236.      }
  237.      if %1 = 2
  238.      {
  239.       set %x #charposx - 1
  240.       set %y #charposy - 1
  241.      }
  242.      if %1 = 3
  243.      {
  244.       set %x #charposx + 1
  245.       set %y #charposy - 1
  246.      }
  247.      if %1 = 4
  248.      {
  249.       set %x #charposx - 1
  250.       set %y #charposy + 1
  251.      }
  252.      if %1 = 5
  253.      {
  254.       set %x #charposx + 1
  255.       set %y #charposy
  256.      }
  257.      if %1 = 6
  258.      {
  259.       set %x #charposx - 1
  260.       set %y #charposy
  261.      }
  262.      if %1 = 7
  263.      {
  264.       set %x #charposx
  265.       set %y #charposy + 1
  266.      }
  267.      if %1 = 8
  268.      {
  269.       set %x #charposx
  270.       set %y #charposy - 1
  271.      }
  272.      return
  273.     {
  274.      if #findcnt > 0
  275.      goto beginloop
  276.      return
  277.     }
  278.     goto start_setup


Top
  Profile 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 9 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: Bing [Bot] and 11 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:  
cron
Powered by phpBB® Forum Software © phpBB Group
Hosted by CalWeb Internet Services, Inc.