2736
« on: December 29, 2013, 08:10:26 AM »
Ok this is from Paulonius' Bowyer Trainer 1.0 Script
I am looking at the main crafting section and I will be asking things on the side in red. I will also comment on what I think it means to see if I am understanding it correctly.
Sub CraftAway
CraftAwayLoop:
finditem %TinkerTools C_ , #backpackid
if #findcnt < 2
gosub MakeTinkerKit
finditem %FletchersTools C_ , #backpackid
if #findcnt < 2
gosub MakeFletchersTools
finditem %FletchersTools C_ , #backpackid
set #lobjectid #findid
event macro 17
gosub waitforgump %cwin
if ! #result
{
Goto CraftAwayLoop
}
Set %Find%CurrentItemAttempts 0
Set %Find%CurrentItemAttemptsSuccess 0 ;;[color=red]I am not sure about these 3 lines, looks like code for a menu but maybe the script uses it to track other than real skill?[/color]
Set %NeedToResetCurrentItem No
REPEAT
{
finditem %FletchersTools C_ , #backpackid ;;[color=red]If there aren't at least 2 fletcher kit it goes to the loop that tell is to make more kits[/color]
If #findcnt < 2
goto CraftAwayLoop
chooseskill bowc real
Set %CurrentSkill #Skill ;; [color=red]I believe this is so the script can reference which items to make[/color]
Gosub OffSetClick 280 450 ; make last ;; [color=red] This confuses me, what if the last thing made was to low and it should have gone to something new?[/color]
gosub waitforgump %cwin
if ! #result ;; [color=red]Checking to see if tool is still working?[/color]
Goto CraftAwayLoop
Finditem %CurrentItem C_ , #BackpackID ;; [color=red] I don't understand this. Is it looking for the item made in the bag? If so, why?[/color]
Set %FindCurrentItemAttempts %FindCurrentItemAttempts + 1
If #FindCnt >= 1
{
Set %FindCurrentItemAttemptsSuccess %FindCurrentItemAttemptsSuccess + 1 ;; [color=red]I am confused on this to, is this and the previous one checking so it knows what to dump but I don't see a ref to weight. Does the weight sub run constantly and independently from the crafting sub?[/color]
Gosub Dump
}
If %FindCurrentItemAttempts > 9 && %FindCurrentItemAttemptsSuccess < 1 ;; [color=red]Does this mean it is going to go to a lower item regardless of skill since it made 9 without a success? Is this the reason for the lines at the beginning?[/color]
Set %NeedToResetCurrentItem Yes
Chooseskill Bowc real
If Siege in #Shard && #Skill >= 700 ;; [color=red]Siege ROT timer, completely understand this one, nice sub! EN's?[/color]
{
GoSub RoT_Timer Bowc
finditem %FletchersTools C_ , #backpackid
If #FindCnt < 1
Goto CraftAwayLoop
set #lobjectid #findid
event macro 17
}
If #skill >= %threshhold || %NeedToResetCurrentItem = Yes
gosub SkillCheck
If #Skill = #SkillCap
Gosub SkillCheck
gosub weightcheck
finditem %Boards C_ , #backpackid
}
UNTIL #findstack < %ItemBoards ;; [color=red]board check? I don't think I have seen a check like this but is it referring to the stack being smaller than the amount needed to make the bow which is addressed in the item1 item2 section of the script?[/color]
Gosub OffsetClick 30 450 ;; [color=red]Does this close out the crafting gump? If so, Why? So it can grab more boards?[/color]
Return
I really appreciate the help in understanding how these subs work so I can make my own.
After previewing it, I see that color is not taken in the code section but it will help make it easier to find my comments lol.