Sign in to follow this  
Followers 0
Symplystyc

Need script help

2 posts in this topic

Func Drink($DrinkType);Type of drink. 0 = Full rejuv, 1 = Regular rejuv, 2 = Merc 
   For $N = 0 To 3 
      $Check = PixelChecksum(($BeltX + ($N * 31)) - 1, $BeltY - 1, ($BeltX + ($N * 31)) + 1, $BeltY + 1, 1) 
      If $Check = $beltfrjchecksum Then 
         $BeltData[$N] = 1 
      ElseIf $Check = $beltrjchecksum Then 
         $BeltData[$N] = 2 
      ElseIf $Check = $beltshpchecksum Then 
         $BeltData[$N] = 3 
      ElseIf $Check = $beltsmpchecksum Then 
         $BeltData[$N] = 4 
      Else 
         $BeltData[$N] = 0 
      EndIf 
   Next 
   LogEvent(0, "Belt Data:") 
   $LogFile = FileOpen($BotDir & "\Logs\LifeCheck.txt", 1) 
   For $N = 0 To 3 
      Select 
         Case $BeltData[$N] = 1 
            FileWrite($LogFile, "(F)") 
         Case $BeltData[$N] = 2 
            FileWrite($LogFile, "(R)") 
         Case $BeltData[$N] = 3
            FileWrite($LogFile, "(H)")
         Case $BeltData[$N] = 4
            FileWrite($LogFile, "(S)")
         Case Else 
            FileWrite($LogFile, "(E)") 
      EndSelect 
   Next 
   FileWrite($LogFile, @CRLF) 
   FileClose($LogFile) 
   $A = 0 
   Select 
      Case $DrinkType = 0                    ;Prioritize Full rejuves 
         For $N = 0 To 3 
            If $BeltData[$N] = 1 Then 
               Send($Char_Key_PotionsRow[$N + 1]) 
               $A = 1 
               LogEvent(0, "Drank a Full Rejuv from belt slot " & $N + 1) 
               ExitLoop 
            EndIf 
        ;Next 
         If $A = 0 Then 
            For $N = 0 To 3 
               If $BeltData[$N] = 2 Then 
                  Send($Char_Key_PotionsRow[$N + 1]) 
                  $A = 1 
                  LogEvent(0, "No more Full Rejuvs, so we Drank a Regular Rejuv instead from belt slot " & $N + 1) 
                  ExitLoop 
              EndIf 
              If $A = 0 Then
                  For $N = 0 to 3
                      If $BeltData[$N] = 3 Then
                          Send($Char_Key_PotionsRow[$N + 1])
                          $A =1
                          LogEvent(0, "No more Rejuvs, so we Drank a Super Healing instad from belt slot " & $N +1)
                          ExitLoop
                      EndIf
                  Next
                EndIf  
            Next 
         EndIf 
         If $A = 0 Then 
            LogEvent(0, "We are out of pots, Chickening...") 
            Chicken() 
        EndIf 
        
      Case $DrinkType = 1                    ;Prioritize Regular rejuves 
         For $N = 0 To 3 
            If $BeltData[$N] = 2 Then 
               Send($Char_Key_PotionsRow[$N + 1]) 
               $A = 1 
               LogEvent(0, "Drank a Regular Rejuv from belt slot " & $N + 1) 
            ExitLoop 
            EndIf 
         Next 
         If $A = 0 Then 
            For $N = 0 To 3 
               If $BeltData[$N] = 3 Then 
                  Send($Char_Key_PotionsRow[$N + 1]) 
                  $A = 1 
                  LogEvent(0, "No more Regular Rejuvs, so we Drank a Super Healing instead from belt slot " & $N + 1) 
                  ExitLoop 
              EndIf 
              If $A = 0 Then
                  For $N = 0 to 3
                      If $BeltData[$N] = 1 Then
                          Send($Char_Key_PotionsRow[$N + 1])
                          $A =1
                          LogEvent(0, "No more Rejuvs, so we Drank a Full Rejuv instad from belt slot " & $N +1)
                          ExitLoop
                      EndIf
                  Next
                EndIf  
            Next 
         EndIf 
         If $A = 0 Then 
            LogEvent(0, "We are out of pots, Chickening...") 
            Chicken() 
        EndIf
        
      Case $DrinkType = 2                    ;Send a pot to the merc, Prioritize Regular rejuves 
         Send("{SHIFTDOWN}") 
         For $N = 0 To 3 
            If $BeltData[$N] = 2 Then 
               Send($Char_Key_PotionsRow[$N + 1]) 
               $A = 1 
               LogEvent(0, "Sent a Regular Rejuv to the Merc from belt slot " & $N + 1) 
               ExitLoop 
            EndIf 
         Next 
         If $A = 0 Then 
            For $N = 0 To 3 
               If $BeltData[$N] = 3 Then 
                  Send($Char_Key_PotionsRow[$N + 1]) 
                  $A = 1 
                  LogEvent(0, "No more Regular Rejuvs to send to the Merc, so we'll send a Healing pot instead from belt slot " & $N + 1) 
                  ExitLoop 
               EndIf 
          Next 
           If $A = 0 Then
                For $N = 0 to 3
                    If $BeltData[$N] = 3 Then
                        Send($Char_Key_PotionsRow[$N + 1])
                        $A =1
                        LogEvent(0, "No more Rejuvs, so we Drank a Full Rejuv instad from belt slot " & $N +1)
                        ExitLoop
                    EndIf
                Next
            EndIf 
         Send("{SHIFTUP}") 
         If $A = 0 Then 
            LogEvent(0, "We are out of pots, Chickening...") 
           ;Chicken() 
         EndIf 
   EndSelect 
EndFunc  ;==>Drink

I know somethings wong with this but I dont know what.


The glass is neither half empty nor half full, it is simply twice as big as it needs to be.

Share this post


Link to post
Share on other sites



I know somethings wong with this but I dont know what.

Your posted script never calls the function Drink(). See? Wasn't that hard.

:rambo:

If there's more to the script, then post it and/or say something about what it's supposed to do, and what it actually does instead.

:rolleyes:


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0