Author Topic: Skill check issue  (Read 3715 times)

0 Members and 1 Guest are viewing this topic.

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 2998
  • Activity:
    3.2%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +205
  • Referrals: 2
    • View Profile
Skill check issue
« on: September 19, 2018, 10:48:36 AM »
0
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:

Code: [Select]
   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
Code: [Select]
     if #skill > 599
      {
       gosub skillcheck
      }

Thoughts?

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: Skill check issue
« Reply #1 on: September 19, 2018, 11:26:53 AM »
0
Code: [Select]
   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.
When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 2998
  • Activity:
    3.2%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +205
  • Referrals: 2
    • View Profile
Re: Skill check issue
« Reply #2 on: September 19, 2018, 11:58:26 AM »
0
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.

Offline Trigs

  • Jr. Member
  • **
  • Posts: 22
  • Activity:
    0%
  • Reputation Power: 1
  • Trigs has no influence.
  • Respect: +1
  • Referrals: 0
    • View Profile
Re: Skill check issue
« Reply #3 on: September 19, 2018, 12:05:41 PM »
0
Code: [Select]
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:

Code: [Select]
chooseSkill Tink

in one of those subfunctions as defined here: http://wiki.easyuo.com/index.php?title=ChooseSkill

Offline 12TimesOver

  • Another Day, Another Vendetta
  • Global Moderator
  • *
  • *
  • Posts: 3694
  • Activity:
    0%
  • Reputation Power: 41
  • 12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.12TimesOver is a force to reckon with.
  • Gender: Male
  • Respect: +321
  • Referrals: 2
    • View Profile
Re: Skill check issue
« Reply #4 on: September 19, 2018, 12:09:14 PM »
0
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.


When they come for me I'll be sitting at my desk
     with a gun in my hand wearing a bulletproof vest
My, my, my how the time does fly
     when you know you're gonna die by the end of the night

Offline CrisisTopic starter

  • Global Moderator
  • *
  • *
  • Posts: 2998
  • Activity:
    3.2%
  • Reputation Power: 41
  • Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.Crisis is a force to reckon with.
  • Gender: Male
  • Scripting well enough to break things!
  • Respect: +205
  • Referrals: 2
    • View Profile
Re: Skill check issue
« Reply #5 on: September 19, 2018, 01:33:36 PM »
0
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!!

Tags: