Author Topic: Issues with a script I've written/tried to write  (Read 3033 times)

0 Members and 1 Guest are viewing this topic.

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Issues with a script I've written/tried to write
« on: December 22, 2015, 07:11:12 AM »
0
Basically, don't slate me, we all have to start somewhere but I have learnt a lot by doing this but I'm now having issues, I ran each sub on it's own and they all worked as intended, I have added them together and am having issues, if anyone could quickly look over this and give me corrections or advice on what I'm done well and not so well, the advice would be appreciated, I want to learn to script and eventually write for you all but I'm going to need a little guidance. Please & Thanks! (I didn't really mess with the wait times as of yet.) Some issues I'm having, getting a certain amount of ingots from the secure and crafting a certain amount of shields, ideally something like getting 1000 ingots and crafting 100 shields and then donating would be nice but I was unsure how to even go about that either

Code: [Select]
set %homerunebook EOSSNOD
set %libraryrunebook JUSSNOD
set %homesecure KJHEFPD
set %ingots ENK
set %smithtool OBG
set %tinkertool JTL
set %donationnpc SKHWH
set %backpack UAJNZOD
set %ingotamount 500



main:
gosub openresourcebag
gosub getingots
gosub checktinkertools
gosub checksmithtools
gosub craftshields
gosub recalltonpc
repeat
{
gosub donate
}
#findcnt FIK C_ , #backpackid
until #findcnt <= 0
gosub recallhome


sub openresourcebag
set #lobjectid %homesecure
Event macro 17 0
wait 10
return

sub getingots
finditem ENK , %homesecure
exevent drag #findid %ingotamount
wait 10
Exevent Dropc #backpackid
wait 10
return

sub recalltonpc
event macro 15 31
target 50
set #ltargetid %libraryrunebook
event macro 22
wait 10
return

sub recallhome
event macro 15 31
target 50
set #ltargetid %homerunebook
event macro 22
wait 10
return

sub checktinkertools
repeat
#findcnt %tinkertool C_ , #backpackid
if #findcnt < 3
{
gosub crafttinkertools
}
finditem %tinkertool C_ , #backpackid
until #findcnt >= 3
if #findcnt >= 3
return

sub checksmithtools
repeat
#findcnt %smithtool C_ , #backpackid
if #findcnt < 3
{
gosub craftsmithtools
}
finditem %smithtool C_ , #backpackid
until #findcnt >= 3
if #findcnt >= 3
return


sub craftshields
finditem %smithtool C_ , #backpackid
set #lobjectid #findid
event macro 17 0
{
      wait 20
      click 318 429
      wait 20
}
return

sub donate
click 302 235 d
wait 10
click 290 318
wait 10
target 20
finditem FIK C_ , #backpackid
set #LtargetID #findid
event macro 22
wait 10
return


sub crafttinkertools
finditem %tinkertool C_ , #backpackid
set #lobjectid #findid
event macro 17 0
wait 10
click 266 115
wait 10
return

sub craftsmithtools
finditem %tinkertool C_ , #backpackid
set #lobjectid #findid
event macro 17 0
wait 30
click 410 252
wait 30
click 262 94
wait 30
return





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: Issues with a script I've written/tried to write
« Reply #1 on: December 22, 2015, 02:01:07 PM »
0


Beleive you forget a goto main

Code: [Select]
main:
gosub openresourcebag
gosub getingots
gosub checktinkertools
gosub checksmithtools
gosub craftshields
gosub recalltonpc
repeat   
{
gosub donate
}
#findcnt FIK C_ , #backpackid
until #findcnt <= 0
gosub recallhome
goto main    < ---------------   This is to make the loop. 

Offline KetchupTopic starter

  • Full Member
  • ***
  • Posts: 138
  • Activity:
    0%
  • Reputation Power: 3
  • Ketchup has no influence.
  • Respect: +18
  • Referrals: 0
    • View Profile
Re: Issues with a script I've written/tried to write
« Reply #2 on: December 22, 2015, 02:35:58 PM »
0
ah okay thanks, that's one issue solved! I think the rest of the script is however noobie written but it was great practice!

Tags: