XenoBot Forums - Powered by vBulletin

User Tag List

Results 1 to 4 of 4

Thread: Counting Monsters

  1. #1

    Join Date
    Dec 2015
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Counting Monsters

    Hello.

    I wrote some condition instruction but its not working. My question is why?

    PHP Code:
            local kongra Self.GetCreatureKills(Kongra)
            
    local ape Self.GetCreatureKills(Sibang)
            
    local merlkin Self.GetCreatureKills(Merlkin)
            
    local all math.max(kongra ape merlkin)
        
            if 
    counttask >= 3 then 
                Walker
    .GoTo("GoToHunt")
                
    end
                
            
    if all >= 300 then
                Self
    .ResetCreatureKills(Kongra)
                
    Self.ResetCreatureKills(Sibang)
                
    Self.ResetCreatureKills(Merlkin)
                
    Walker.GoTo("Task")    
                
    end
                
            
    if all <= 300 then
                Walker
    .Goto("GoToHunt")
            
    end 
    counttask is set for 0 and it adds 1 everytime when hes at grizzly.

  2. #2
    fioletowya's Avatar
    Join Date
    Nov 2015
    Posts
    26
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Seligeari View Post
    Hello.

    I wrote some condition instruction but its not working. My question is why?

    PHP Code:
            local kongra Self.GetCreatureKills(Kongra)
            
    local ape Self.GetCreatureKills(Sibang)
            
    local merlkin Self.GetCreatureKills(Merlkin)
            
    local all math.max(kongra ape merlkin)
        
            if 
    counttask >= 3 then 
                Walker
    .GoTo("GoToHunt")
                
    end
                
            
    if all >= 300 then
                Self
    .ResetCreatureKills(Kongra)
                
    Self.ResetCreatureKills(Sibang)
                
    Self.ResetCreatureKills(Merlkin)
                
    Walker.GoTo("Task")    
                
    end
                
            
    if all <= 300 then
                Walker
    .Goto("GoToHunt")
            
    end 
    counttask is set for 0 and it adds 1 everytime when hes at grizzly.
    Code:
    Self.GetCreatureKills(Kongra) -> Self.GetCreatureKills("Kongra")

  3. #3

    Join Date
    Dec 2015
    Posts
    7
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I understand your post as replace old one with new ones am i right?

  4. #4
    Senior Member XtrmJosh's Avatar
    Join Date
    Apr 2012
    Location
    Cambridge, England
    Posts
    1,324
    Mentioned
    39 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Seligeari View Post
    I understand your post as replace old one with new ones am i right?
    Kongra, Sibang, and Merlkin are not variables and will be unrecognised by the scripting engine. You need to declare string type variables according to the conventions of the language which you are using. In this case, they need to be wrapped in quotes.

    Observe the difference between:

    Code:
    myVariable = Some Creature Name
    and

    Code:
    myVariable = "Some Creature Name"
    Running the former, if you explore how the scripting engines work, you will likely notice that it fails trying to assign the value of the variable Some to the variable myVariable, It will not recognise Some as a variable, and as such will complain accordingly. If, by pure coincidence, Some was a valid variable, it would then look for Creature. If both Creature and Name happened to be recognised as variables, then myVariable would eventually be assigned the value of the variable Name. This is not what you want to do.
    Last edited by XtrmJosh; 12-17-2015 at 06:52 PM.
    You cannot fail, so I'm lowering the standard.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •