ScriptUO
Official ScriptUO EasyUO Scripts => Script Debug => Topic started by: Crisis on September 19, 2018, 10:48:36 AM
-
I am having issues with a skill check being performed and I am not sure if it is related to the script or the fact that it is a free shard. So my thoughts on this sub is that it should continue to make tongs until tinkering skill hits 60, then it should go to a skillcheck sub which tells it where to go next. The problem I am having is that it is skipping the check and going to the actual skillcheck sub. Here is the sub:
sub Tongs ;45-60 skill
set %tink_item Tongs
chooseSkill Tink real
gosub newstatus lime black 10 Checking Resources
gosub MWResource %Resource_Secure %ingots N/A 10 100
gosub CheckTink
gosub newstatus lime black 10 Crafting %tink_item
gosub MWCraft Tinkering N/A 3 2 3
gosub AddAttempts
goSub MenuSkillCheck
gosub Calc_Time
Repeat
gosub CheckTink
gosub newstatus lime black 10 Checking Resources
gosub MWResource %Resource_Secure %ingots N/A 10 100
gosub newstatus lime black 10 Crafting %tink_item
gosub MWCraft Tinkering Makelast
gosub AddAttempts
goSub MenuSkillCheck
gosub Calc_Time
if #skill = 600
{
gosub skillcheck
}
gosub CheckWeight %tink_item %Trashbarrel
Return
I have also tried to check the skill with this
if #skill > 599
{
gosub skillcheck
}
Thoughts?
-
sub Tongs ;45-60 skill
set %tink_item Tongs
chooseSkill Tink real
gosub newstatus lime black 10 Checking Resources
gosub MWResource %Resource_Secure %ingots N/A 10 100
gosub CheckTink
gosub newstatus lime black 10 Crafting %tink_item
gosub MWCraft Tinkering N/A 3 2 3
gosub AddAttempts
goSub MenuSkillCheck
gosub Calc_Time
Repeat
gosub CheckTink
gosub newstatus lime black 10 Checking Resources
gosub MWResource %Resource_Secure %ingots N/A 10 100
gosub newstatus lime black 10 Crafting %tink_item
gosub MWCraft Tinkering Makelast
gosub AddAttempts
goSub MenuSkillCheck
gosub Calc_Time
if #skill = 600
{
gosub skillcheck
}
gosub CheckWeight %tink_item %Trashbarrel
Return
Well, it's hard to know exactly what's going on because there are many sub calls for which we don't see the code but the one thing that jumped out at me right away is you don't close your Repeat/Until loop.
-
I am not sure if I want to end up posting this or not since it is for a specific shard so I only posted this part. Where/how would you close the repeat/until loop? If needed I can post this in the elite section so it does not go public.
-
repeat
{
; some code
; goes here
}
until #skill > %someValue
Or whatever "until" condition you want. I'm not sure if that's the issue
I assumine you are calling something like:
chooseSkill Tink
in one of those subfunctions as defined here: http://wiki.easyuo.com/index.php?title=ChooseSkill
-
Well, the repeat loop isn't going to repeat, it's just going to go to the Return at the end of the sub.
A Repeat is used to do something until a criteria is met then move on (or simply leave the loop and never go back via a goto or gosub that doesn't return, both of which would be poor coding practice in most cases). So, where would you need to repeat the series of tasks until? THAT is where you close your loop and give it a criteria - e.g. "Until %numbercrafted = 10" or "until %domynutsitch = #FALSE", etc.
-
Thank you both! I am back on track again and so much to learn. Every time I think I am getting better, I hit a snag, learn more, and actually get better! Go figure lol. I am scripting well enough to break things!!