XenoBot Forums - Powered by vBulletin

User Tag List

Page 2 of 7 FirstFirst 1234 ... LastLast
Results 11 to 20 of 70

Thread: New update mess with scripts?

  1. #11
    Senior Member XtrmJosh's Avatar
    Join Date
    Apr 2012
    Location
    Cambridge, England
    Posts
    1,324
    Mentioned
    39 Post(s)
    Tagged
    0 Thread(s)
    @xiaospike @Joshwa534

    As I continue to encounter your incredibly shit scripts, I've decided I'll take the opportunity to point out the flaws of this particular script. They are listed below. If you care to do something about them, that's your decision, but for the love of god stop distributing this shit.

    Code:
        print([[
        Yalahar Minotaurs or Elves by Xiaospike & Joshwa534]])
        wait(5000)
    Why do you insert a 5 second wait after starting the script? This raises a couple of issues, not least being that if in your first couple of waypoints you happen to have a label, it will be ignored. This poses a potential risk to the end user, and is a complete waste of a thread.

    Code:
    		local ESTMana = (MaxMana-20)
    		Walker.ConditionalGoto((Self.ItemCount(268) < ESTMana) or (Self.ItemCount(266) < MaxHealth) or (Self.ItemCount(7378) < MaxAmmo), "resupply", "tohunt")
    Here's an interesting one... Why are you wasting time declaring a variable? Why not just do Walker.ConditionalGoto(Self.ItemCount(268) < MaxMana - 20~~~~~. If you really wanted to use a variable in this instance it would be far more convenient to use a variable to store the variability of the function (the number 20), that way you could allow the end user to set it to a value, so that if they will only use 2 or 3 manas at most on refilling (most likely) they will refill every time (even if they only deposited because of capacity...)

    Code:
    		local withdrawManas = math.max(MaxMana - Self.ItemCount(268), 0)*50
    		local withdrawHealths = math.max(MaxHealth - Self.ItemCount(266), 0)*45
    		local withdrawAmmo = math.max(MaxAmmo - Self.ItemCount(7378), 0)*15
    		local totalmoneyneeded = (withdrawManas + withdrawHealths + withdrawAmmo)
    		local MATHCEIL = (math.ceil((totalmoneyneeded/1000)))*1000
    OK, so this is a large chunk to comment on. Firstly, it's ugly as hell. A much more organised way to do this would be to make a function and name it CalculateItemCost, pass in a variable for amount to buy, item ID, and cost per item, then perform these calculations and return the value. It looks shit, and is difficult to debug as a result. Secondly, why would you attempt to truncate a number in such a way? As you are simply rounding, you could use the function math.round. Sure, math.ceil will do the same job, but it once again makes code unreadable and difficult to debug. Last comment about this point, how many people wrote this code? I've noticed elsewhere as well, that your naming convention is to name it whatever the hell you want (e.g totalmoneyneeded all lower case, MATHCEIL very non-descriptive and all upper case, then the camel convention for withdrawHealths etc...) This is incredibly bad practise and anyone in the programming or scripting industry would mock you for it. It is laughable that you have actually managed to use 3 different conventions in 3 consecutive lines. Oh, I almost forgot, why exactly did you put so many brackets on the math.ceil line? Or wait, are you trying to make your code impossible to read? That does seem like the sole intention of this particular script.

    Code:
    		wait(2000)
    Why bother? I mean, seriously, what is the point? If you really wanted to make something here which would ensure the money was withdrawn, just add a balance check at the end of the withdrawing lines. The bot does not take 2 seconds to do what it is supposed to be doing here. Never has done, never will do. Exactly 2 seconds, as well? Hmmmm...

    Code:
    		if (LogoutStamina) and (Self.Stamina() < 960) then
    It seems very unintuitive to assume that an end user wants to log out with 2 hours remaining. A round of most hunts for me is much less than an hour, another thing which would be beneficial to have as a variable. On top of that, here's your fourth naming convention. Well done. Include a fifth next time for a free gift voucher!

    Code:
    			Self.SayToNpc({"hi", "flasks", "yes", "yes", "yes", "yes", "yes", "yes", "trade"}, 65)
    What the shit? So someone's just started up your script... It goes to the bank, withdraws 0 money, then goes to a mana shop... I know what it should do next! It should spam the word yes in an attempt to sell flasks which it doesn't have any of! Yes! Perfect way to get banned, fucking marvellous! You know what's even better than that? Every time I go to that shop, why not make it do the same thing? Ohh, you already did. On top of that, why not make a script which is obviously targeting players < level 50 try to sell 600 potion flasks! Great! Good job, well done. Learn to use a while true statement, and you can simple say yes until you have no flasks left. If you really want to be random about it, use some randomisation (say yes once for each stack of flasks, plus zero, one, two, or three times depending on the state of a randomly generated number). Don't do this shit, you're just making it fucking obvious who is botting.

    Code:
    			wait(2000)
    			if (Self.ItemCount(268) < MaxMana) then
    				BuyItems(268, MaxMana)
    				wait(500)			
    			end
    			if (Self.ItemCount(266) < MaxHealth) then
    				BuyItems(266, MaxHealth)
    				wait(500)
    			end
    			wait(200, 500)
    Again with these fucking waits? Seriously, why?! I know... Let's walk up to an NPC, and wait exactly 2 seconds. Next, we'll buy some mana potions and wait exactly half a second. Then, we'll buy some health potions and I tell you what, why not wait exactly another half a second. After that, maybe we can wait another 200-500 milliseconds, cause that will totally be amazingly fun! What the fuck?

    Code:
    	elseif (labelName == "buyammo") then
    		Walker.Stop()
    		Self.SayToNpc({"hi", "trade"}, 65)
    		wait(1000)
    		if (Self.ItemCount(7378) < (MaxAmmo)) then
    			BuyItems(7378, MaxAmmo)
    			wait(500)
    		end
    		Walker.Start()
    Ok, so we're now saying trade to NPCs before trading? It's not "bad", as I guess that the function (not made by yourselves, of course, because it actually works as it should) to buy items will check that the trade window is open, but this is a waste of calculations. I see you had another great idea here, to say trade, wait exactly a second, then buy some potions, then wait exactly half a second and walk off. Inconspicuous.

    Code:
    	elseif (labelName == "resetbp") then
    		Walker.Stop()
    		Container.Close(GoldBP)
    		wait(1000)		
    		Container.GetFirst():OpenChildren(GoldBP)
    		wait(1000)
    		Container.GetByName(GoldBP):Minimize()
    		if (HideEquipment) then
    			Client.HideEquipment()
    			wait(1000)
    		end
    		Walker.Start()	
    	end
    Should I even bitch about the sleeps here? Do I need to? What this is going to do:
    Close the gold BP.
    Wait exactly 1 second.
    Open the gold BP.
    Wait exactly 1 second.
    Minimise the gold BP.
    Hide the equipment.
    Wait exactly 1 second.
    Walk off.

    You don't think this is becoming a pattern?

    Ok, so let's move on to the functions you use:

    Code:
    function SellItems(item) -- item = item ID
    	wait(300, 1700)
    	Self.ShopSellItem(item, Self.ShopGetItemSaleCount(item))
    	wait(900, 1200)
    end
    Wait, buy, wait? Why not use a convention? Why waste time waiting before and (sometimes) after every function, when you could just be waiting before every function? I think I know the answer you're going to give (if any), and I suspect you will say something like "we did that incase someone else tries to copy this code, so they won't risk getting banned by doing shit too quickly", but then again there is a large part of me that suspects that you didn't even write this code, so meh.

    Code:
    function BuyItems(item, count) -- item = item id, count = how many you want to buy up to
    	wait(900, 1200)
    	if (Self.ItemCount(item) < count) then
    	Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
    	wait(200, 500)
    	end
    end
    This one is quite strange... Why would your first wait be outside of the if statement, and your second inside? It makes no sense. Then again, based on the code I've reviewed so far, it seems that your primary "company principle" is something like "If there is nothing else to do, wait." Good one. After reviewing this post, it's also just come to my attention that in fact you are waiting a bit, then this function is called, then it's waiting some more, then it's doing something, then waiting some more, then waiting some more again, then it's gonna do something else. Yeah, it's semi-random (primarily because this piece of code is not designed to have wait calls before and after it), but fuck me it's wasteful.

    I won't comment on the rest of the functions, as I do not believe you wrote them. Feel free to correct me if I'm wrong, but I doubt you have the capacity to write anything capable of doing anything productive.

    @inadequate - For the reasons listed above, I won't debug this code for you. If you want it fixed, I'm sure JXScripts will happily do so. Personally, I don't have the time to even begin repairing this shoddy work. Sorry.
    Last edited by XtrmJosh; 06-28-2013 at 03:01 AM.
    You cannot fail, so I'm lowering the standard.

  2. #12
    Senior Member XtrmJosh's Avatar
    Join Date
    Apr 2012
    Location
    Cambridge, England
    Posts
    1,324
    Mentioned
    39 Post(s)
    Tagged
    0 Thread(s)
    @inadequate - This line is most likely your problem:


    Code:
        elseif (labelName == "checkstuff") then
    		local ESTMana = (MaxMana-20)
    		Walker.ConditionalGoto((Self.ItemCount(268) < ESTMana) or (Self.ItemCount(266) < MaxHealth) or (Self.ItemCount(7378) < MaxAmmo), "resupply", "tohunt")
    Best way to debug it? Select that code, and paste this over it:

    Code:
        elseif (labelName == "checkstuff") then
    		local ESTMana = (MaxMana-20)
    		if (Self.ItemCount(268) < ESTMana) then
    			print("Refilling because of manas")
    		elseif (Self.ItemCount(266) < MaxHealth) then
    			print(Refilling because of healths)
    		elseif (Self.ItemCount(7378) < MaxAmmo) then
    			print("Refilling because of ammunition")
    		
    		Walker.ConditionalGoto((Self.ItemCount(268) < ESTMana) or (Self.ItemCount(266) < MaxHealth) or (Self.ItemCount(7378) < MaxAmmo), "resupply", "tohunt")
    When this line is processed, you will see a message in Tibia saying why it is refilling. After that you can see if one of the variables is configured incorrectly (most likely situation). If you're still stuck, post the result and I will see what I can do. As I said though, I'm not gonna be willing to look in any more depth through this code, it's not readable, user friendly, nor anything that I would personally trust to use on one of my accounts.
    You cannot fail, so I'm lowering the standard.

  3. #13
    inadequate's Avatar
    Join Date
    Jun 2013
    Location
    United States
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    All fixed, Joshwa534 helped me out with it, thank you for your time anyway guys

  4. #14
    Senior Member kopper's Avatar
    Join Date
    Sep 2011
    Location
    NE, USA
    Posts
    412
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by XtrmJosh View Post
    @xiaospike @Joshwa534

    As I continue to encounter your incredibly shit scripts, I've decided I'll take the opportunity to point out the flaws of this particular script. They are listed below. If you care to do something about them, that's your decision, but for the love of god stop distributing this shit.

    Code:
        print([[
        Yalahar Minotaurs or Elves by Xiaospike & Joshwa534]])
        wait(5000)
    Why do you insert a 5 second wait after starting the script? This raises a couple of issues, not least being that if in your first couple of waypoints you happen to have a label, it will be ignored. This poses a potential risk to the end user, and is a complete waste of a thread.

    Code:
    		local ESTMana = (MaxMana-20)
    		Walker.ConditionalGoto((Self.ItemCount(268) < ESTMana) or (Self.ItemCount(266) < MaxHealth) or (Self.ItemCount(7378) < MaxAmmo), "resupply", "tohunt")
    Here's an interesting one... Why are you wasting time declaring a variable? Why not just do Walker.ConditionalGoto(Self.ItemCount(268) < MaxMana - 20~~~~~. If you really wanted to use a variable in this instance it would be far more convenient to use a variable to store the variability of the function (the number 20), that way you could allow the end user to set it to a value, so that if they will only use 2 or 3 manas at most on refilling (most likely) they will refill every time (even if they only deposited because of capacity...)

    Code:
    		local withdrawManas = math.max(MaxMana - Self.ItemCount(268), 0)*50
    		local withdrawHealths = math.max(MaxHealth - Self.ItemCount(266), 0)*45
    		local withdrawAmmo = math.max(MaxAmmo - Self.ItemCount(7378), 0)*15
    		local totalmoneyneeded = (withdrawManas + withdrawHealths + withdrawAmmo)
    		local MATHCEIL = (math.ceil((totalmoneyneeded/1000)))*1000
    OK, so this is a large chunk to comment on. Firstly, it's ugly as hell. A much more organised way to do this would be to make a function and name it CalculateItemCost, pass in a variable for amount to buy, item ID, and cost per item, then perform these calculations and return the value. It looks shit, and is difficult to debug as a result. Secondly, why would you attempt to truncate a number in such a way? As you are simply rounding, you could use the function math.round. Sure, math.ceil will do the same job, but it once again makes code unreadable and difficult to debug. Last comment about this point, how many people wrote this code? I've noticed elsewhere as well, that your naming convention is to name it whatever the hell you want (e.g totalmoneyneeded all lower case, MATHCEIL very non-descriptive and all upper case, then the camel convention for withdrawHealths etc...) This is incredibly bad practise and anyone in the programming or scripting industry would mock you for it. It is laughable that you have actually managed to use 3 different conventions in 3 consecutive lines. Oh, I almost forgot, why exactly did you put so many brackets on the math.ceil line? Or wait, are you trying to make your code impossible to read? That does seem like the sole intention of this particular script.

    Code:
    		wait(2000)
    Why bother? I mean, seriously, what is the point? If you really wanted to make something here which would ensure the money was withdrawn, just add a balance check at the end of the withdrawing lines. The bot does not take 2 seconds to do what it is supposed to be doing here. Never has done, never will do. Exactly 2 seconds, as well? Hmmmm...

    Code:
    		if (LogoutStamina) and (Self.Stamina() < 960) then
    It seems very unintuitive to assume that an end user wants to log out with 2 hours remaining. A round of most hunts for me is much less than an hour, another thing which would be beneficial to have as a variable. On top of that, here's your fourth naming convention. Well done. Include a fifth next time for a free gift voucher!

    Code:
    			Self.SayToNpc({"hi", "flasks", "yes", "yes", "yes", "yes", "yes", "yes", "trade"}, 65)
    What the shit? So someone's just started up your script... It goes to the bank, withdraws 0 money, then goes to a mana shop... I know what it should do next! It should spam the word yes in an attempt to sell flasks which it doesn't have any of! Yes! Perfect way to get banned, fucking marvellous! You know what's even better than that? Every time I go to that shop, why not make it do the same thing? Ohh, you already did. On top of that, why not make a script which is obviously targeting players < level 50 try to sell 600 potion flasks! Great! Good job, well done. Learn to use a while true statement, and you can simple say yes until you have no flasks left. If you really want to be random about it, use some randomisation (say yes once for each stack of flasks, plus zero, one, two, or three times depending on the state of a randomly generated number). Don't do this shit, you're just making it fucking obvious who is botting.

    Code:
    			wait(2000)
    			if (Self.ItemCount(268) < MaxMana) then
    				BuyItems(268, MaxMana)
    				wait(500)			
    			end
    			if (Self.ItemCount(266) < MaxHealth) then
    				BuyItems(266, MaxHealth)
    				wait(500)
    			end
    			wait(200, 500)
    Again with these fucking waits? Seriously, why?! I know... Let's walk up to an NPC, and wait exactly 2 seconds. Next, we'll buy some mana potions and wait exactly half a second. Then, we'll buy some health potions and I tell you what, why not wait exactly another half a second. After that, maybe we can wait another 200-500 milliseconds, cause that will totally be amazingly fun! What the fuck?

    Code:
    	elseif (labelName == "buyammo") then
    		Walker.Stop()
    		Self.SayToNpc({"hi", "trade"}, 65)
    		wait(1000)
    		if (Self.ItemCount(7378) < (MaxAmmo)) then
    			BuyItems(7378, MaxAmmo)
    			wait(500)
    		end
    		Walker.Start()
    Ok, so we're now saying trade to NPCs before trading? It's not "bad", as I guess that the function (not made by yourselves, of course, because it actually works as it should) to buy items will check that the trade window is open, but this is a waste of calculations. I see you had another great idea here, to say trade, wait exactly a second, then buy some potions, then wait exactly half a second and walk off. Inconspicuous.

    Code:
    	elseif (labelName == "resetbp") then
    		Walker.Stop()
    		Container.Close(GoldBP)
    		wait(1000)		
    		Container.GetFirst():OpenChildren(GoldBP)
    		wait(1000)
    		Container.GetByName(GoldBP):Minimize()
    		if (HideEquipment) then
    			Client.HideEquipment()
    			wait(1000)
    		end
    		Walker.Start()	
    	end
    Should I even bitch about the sleeps here? Do I need to? What this is going to do:
    Close the gold BP.
    Wait exactly 1 second.
    Open the gold BP.
    Wait exactly 1 second.
    Minimise the gold BP.
    Hide the equipment.
    Wait exactly 1 second.
    Walk off.

    You don't think this is becoming a pattern?

    Ok, so let's move on to the functions you use:

    Code:
    function SellItems(item) -- item = item ID
    	wait(300, 1700)
    	Self.ShopSellItem(item, Self.ShopGetItemSaleCount(item))
    	wait(900, 1200)
    end
    Wait, buy, wait? Why not use a convention? Why waste time waiting before and (sometimes) after every function, when you could just be waiting before every function? I think I know the answer you're going to give (if any), and I suspect you will say something like "we did that incase someone else tries to copy this code, so they won't risk getting banned by doing shit too quickly", but then again there is a large part of me that suspects that you didn't even write this code, so meh.

    Code:
    function BuyItems(item, count) -- item = item id, count = how many you want to buy up to
    	wait(900, 1200)
    	if (Self.ItemCount(item) < count) then
    	Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
    	wait(200, 500)
    	end
    end
    This one is quite strange... Why would your first wait be outside of the if statement, and your second inside? It makes no sense. Then again, based on the code I've reviewed so far, it seems that your primary "company principle" is something like "If there is nothing else to do, wait." Good one. After reviewing this post, it's also just come to my attention that in fact you are waiting a bit, then this function is called, then it's waiting some more, then it's doing something, then waiting some more, then waiting some more again, then it's gonna do something else. Yeah, it's semi-random (primarily because this piece of code is not designed to have wait calls before and after it), but fuck me it's wasteful.

    I won't comment on the rest of the functions, as I do not believe you wrote them. Feel free to correct me if I'm wrong, but I doubt you have the capacity to write anything capable of doing anything productive.

    @inadequate - For the reasons listed above, I won't debug this code for you. If you want it fixed, I'm sure JXScripts will happily do so. Personally, I don't have the time to even begin repairing this shoddy work. Sorry.
    Just got one thing to say to you. Grow up, get out of the house every once in a while. You "don't have the time to "debug" our scripts which work perfectly fine yet you can make this giant post about it? Right.

  5. #15
    XenoBot Scripts Developer Joshwa534's Avatar
    Join Date
    May 2012
    Location
    Texas, USA
    Posts
    4,890
    Mentioned
    517 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by XtrmJosh View Post
    @xiaospike @Joshwa534

    As I continue to encounter your incredibly shit scripts, I've decided I'll take the opportunity to point out the flaws of this particular script. They are listed below. If you care to do something about them, that's your decision, but for the love of god stop distributing this shit.

    Code:
        print([[
        Yalahar Minotaurs or Elves by Xiaospike & Joshwa534]])
        wait(5000)
    Why do you insert a 5 second wait after starting the script? This raises a couple of issues, not least being that if in your first couple of waypoints you happen to have a label, it will be ignored. This poses a potential risk to the end user, and is a complete waste of a thread.

    Code:
    		local ESTMana = (MaxMana-20)
    		Walker.ConditionalGoto((Self.ItemCount(268) < ESTMana) or (Self.ItemCount(266) < MaxHealth) or (Self.ItemCount(7378) < MaxAmmo), "resupply", "tohunt")
    Here's an interesting one... Why are you wasting time declaring a variable? Why not just do Walker.ConditionalGoto(Self.ItemCount(268) < MaxMana - 20~~~~~. If you really wanted to use a variable in this instance it would be far more convenient to use a variable to store the variability of the function (the number 20), that way you could allow the end user to set it to a value, so that if they will only use 2 or 3 manas at most on refilling (most likely) they will refill every time (even if they only deposited because of capacity...)

    Code:
    		local withdrawManas = math.max(MaxMana - Self.ItemCount(268), 0)*50
    		local withdrawHealths = math.max(MaxHealth - Self.ItemCount(266), 0)*45
    		local withdrawAmmo = math.max(MaxAmmo - Self.ItemCount(7378), 0)*15
    		local totalmoneyneeded = (withdrawManas + withdrawHealths + withdrawAmmo)
    		local MATHCEIL = (math.ceil((totalmoneyneeded/1000)))*1000
    OK, so this is a large chunk to comment on. Firstly, it's ugly as hell. A much more organised way to do this would be to make a function and name it CalculateItemCost, pass in a variable for amount to buy, item ID, and cost per item, then perform these calculations and return the value. It looks shit, and is difficult to debug as a result. Secondly, why would you attempt to truncate a number in such a way? As you are simply rounding, you could use the function math.round. Sure, math.ceil will do the same job, but it once again makes code unreadable and difficult to debug. Last comment about this point, how many people wrote this code? I've noticed elsewhere as well, that your naming convention is to name it whatever the hell you want (e.g totalmoneyneeded all lower case, MATHCEIL very non-descriptive and all upper case, then the camel convention for withdrawHealths etc...) This is incredibly bad practise and anyone in the programming or scripting industry would mock you for it. It is laughable that you have actually managed to use 3 different conventions in 3 consecutive lines. Oh, I almost forgot, why exactly did you put so many brackets on the math.ceil line? Or wait, are you trying to make your code impossible to read? That does seem like the sole intention of this particular script.

    Code:
    		wait(2000)
    Why bother? I mean, seriously, what is the point? If you really wanted to make something here which would ensure the money was withdrawn, just add a balance check at the end of the withdrawing lines. The bot does not take 2 seconds to do what it is supposed to be doing here. Never has done, never will do. Exactly 2 seconds, as well? Hmmmm...

    Code:
    		if (LogoutStamina) and (Self.Stamina() < 960) then
    It seems very unintuitive to assume that an end user wants to log out with 2 hours remaining. A round of most hunts for me is much less than an hour, another thing which would be beneficial to have as a variable. On top of that, here's your fourth naming convention. Well done. Include a fifth next time for a free gift voucher!

    Code:
    			Self.SayToNpc({"hi", "flasks", "yes", "yes", "yes", "yes", "yes", "yes", "trade"}, 65)
    What the shit? So someone's just started up your script... It goes to the bank, withdraws 0 money, then goes to a mana shop... I know what it should do next! It should spam the word yes in an attempt to sell flasks which it doesn't have any of! Yes! Perfect way to get banned, fucking marvellous! You know what's even better than that? Every time I go to that shop, why not make it do the same thing? Ohh, you already did. On top of that, why not make a script which is obviously targeting players < level 50 try to sell 600 potion flasks! Great! Good job, well done. Learn to use a while true statement, and you can simple say yes until you have no flasks left. If you really want to be random about it, use some randomisation (say yes once for each stack of flasks, plus zero, one, two, or three times depending on the state of a randomly generated number). Don't do this shit, you're just making it fucking obvious who is botting.

    Code:
    			wait(2000)
    			if (Self.ItemCount(268) < MaxMana) then
    				BuyItems(268, MaxMana)
    				wait(500)			
    			end
    			if (Self.ItemCount(266) < MaxHealth) then
    				BuyItems(266, MaxHealth)
    				wait(500)
    			end
    			wait(200, 500)
    Again with these fucking waits? Seriously, why?! I know... Let's walk up to an NPC, and wait exactly 2 seconds. Next, we'll buy some mana potions and wait exactly half a second. Then, we'll buy some health potions and I tell you what, why not wait exactly another half a second. After that, maybe we can wait another 200-500 milliseconds, cause that will totally be amazingly fun! What the fuck?

    Code:
    	elseif (labelName == "buyammo") then
    		Walker.Stop()
    		Self.SayToNpc({"hi", "trade"}, 65)
    		wait(1000)
    		if (Self.ItemCount(7378) < (MaxAmmo)) then
    			BuyItems(7378, MaxAmmo)
    			wait(500)
    		end
    		Walker.Start()
    Ok, so we're now saying trade to NPCs before trading? It's not "bad", as I guess that the function (not made by yourselves, of course, because it actually works as it should) to buy items will check that the trade window is open, but this is a waste of calculations. I see you had another great idea here, to say trade, wait exactly a second, then buy some potions, then wait exactly half a second and walk off. Inconspicuous.

    Code:
    	elseif (labelName == "resetbp") then
    		Walker.Stop()
    		Container.Close(GoldBP)
    		wait(1000)		
    		Container.GetFirst():OpenChildren(GoldBP)
    		wait(1000)
    		Container.GetByName(GoldBP):Minimize()
    		if (HideEquipment) then
    			Client.HideEquipment()
    			wait(1000)
    		end
    		Walker.Start()	
    	end
    Should I even bitch about the sleeps here? Do I need to? What this is going to do:
    Close the gold BP.
    Wait exactly 1 second.
    Open the gold BP.
    Wait exactly 1 second.
    Minimise the gold BP.
    Hide the equipment.
    Wait exactly 1 second.
    Walk off.

    You don't think this is becoming a pattern?

    Ok, so let's move on to the functions you use:

    Code:
    function SellItems(item) -- item = item ID
    	wait(300, 1700)
    	Self.ShopSellItem(item, Self.ShopGetItemSaleCount(item))
    	wait(900, 1200)
    end
    Wait, buy, wait? Why not use a convention? Why waste time waiting before and (sometimes) after every function, when you could just be waiting before every function? I think I know the answer you're going to give (if any), and I suspect you will say something like "we did that incase someone else tries to copy this code, so they won't risk getting banned by doing shit too quickly", but then again there is a large part of me that suspects that you didn't even write this code, so meh.

    Code:
    function BuyItems(item, count) -- item = item id, count = how many you want to buy up to
    	wait(900, 1200)
    	if (Self.ItemCount(item) < count) then
    	Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
    	wait(200, 500)
    	end
    end
    This one is quite strange... Why would your first wait be outside of the if statement, and your second inside? It makes no sense. Then again, based on the code I've reviewed so far, it seems that your primary "company principle" is something like "If there is nothing else to do, wait." Good one. After reviewing this post, it's also just come to my attention that in fact you are waiting a bit, then this function is called, then it's waiting some more, then it's doing something, then waiting some more, then waiting some more again, then it's gonna do something else. Yeah, it's semi-random (primarily because this piece of code is not designed to have wait calls before and after it), but fuck me it's wasteful.

    I won't comment on the rest of the functions, as I do not believe you wrote them. Feel free to correct me if I'm wrong, but I doubt you have the capacity to write anything capable of doing anything productive.

    @inadequate - For the reasons listed above, I won't debug this code for you. If you want it fixed, I'm sure JXScripts will happily do so. Personally, I don't have the time to even begin repairing this shoddy work. Sorry.
    Quote Originally Posted by XtrmJosh View Post
    @inadequate - This line is most likely your problem:


    Code:
        elseif (labelName == "checkstuff") then
    		local ESTMana = (MaxMana-20)
    		Walker.ConditionalGoto((Self.ItemCount(268) < ESTMana) or (Self.ItemCount(266) < MaxHealth) or (Self.ItemCount(7378) < MaxAmmo), "resupply", "tohunt")
    Best way to debug it? Select that code, and paste this over it:

    Code:
        elseif (labelName == "checkstuff") then
    		local ESTMana = (MaxMana-20)
    		if (Self.ItemCount(268) < ESTMana) then
    			print("Refilling because of manas")
    		elseif (Self.ItemCount(266) < MaxHealth) then
    			print(Refilling because of healths)
    		elseif (Self.ItemCount(7378) < MaxAmmo) then
    			print("Refilling because of ammunition")
    		
    		Walker.ConditionalGoto((Self.ItemCount(268) < ESTMana) or (Self.ItemCount(266) < MaxHealth) or (Self.ItemCount(7378) < MaxAmmo), "resupply", "tohunt")
    When this line is processed, you will see a message in Tibia saying why it is refilling. After that you can see if one of the variables is configured incorrectly (most likely situation). If you're still stuck, post the result and I will see what I can do. As I said though, I'm not gonna be willing to look in any more depth through this code, it's not readable, user friendly, nor anything that I would personally trust to use on one of my accounts.
    As to your answer to @inadequate, the issue was on the user.

    Whatever your wall of text said, I'm not going to bother answering most of your questions. If you wish to scrutinize old code then go ahead but I'm not going to update old code with old code when we're currently revamping everything as a whole. If you still have issues then, go ahead and bitch about it but until then stop trying to get my attention and wipe that shit off your face @Avatar.

    Let me know when you start selling scripts and learn how to deal with your customers. So far I don't see you posting a single piece of code here, for anyone.

  6. #16
    Senior Member kopper's Avatar
    Join Date
    Sep 2011
    Location
    NE, USA
    Posts
    412
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by XtrmJosh View Post
    @inadequate - This line is most likely your problem:


    Code:
        elseif (labelName == "checkstuff") then
    		local ESTMana = (MaxMana-20)
    		Walker.ConditionalGoto((Self.ItemCount(268) < ESTMana) or (Self.ItemCount(266) < MaxHealth) or (Self.ItemCount(7378) < MaxAmmo), "resupply", "tohunt")
    Best way to debug it? Select that code, and paste this over it:

    Code:
        elseif (labelName == "checkstuff") then
    		local ESTMana = (MaxMana-20)
    		if (Self.ItemCount(268) < ESTMana) then
    			print("Refilling because of manas")
    		elseif (Self.ItemCount(266) < MaxHealth) then
    			print(Refilling because of healths)
    		elseif (Self.ItemCount(7378) < MaxAmmo) then
    			print("Refilling because of ammunition")
    		
    		Walker.ConditionalGoto((Self.ItemCount(268) < ESTMana) or (Self.ItemCount(266) < MaxHealth) or (Self.ItemCount(7378) < MaxAmmo), "resupply", "tohunt")
    When this line is processed, you will see a message in Tibia saying why it is refilling. After that you can see if one of the variables is configured incorrectly (most likely situation). If you're still stuck, post the result and I will see what I can do. As I said though, I'm not gonna be willing to look in any more depth through this code, it's not readable, user friendly, nor anything that I would personally trust to use on one of my accounts.
    Yet you've bought two of our scripts. Well done.

  7. #17
    XenoBot Scripts Developer Joshwa534's Avatar
    Join Date
    May 2012
    Location
    Texas, USA
    Posts
    4,890
    Mentioned
    517 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by inadequate View Post
    All fixed, Joshwa534 helped me out with it, thank you for your time anyway guys
    You're welcome buddy, I won't promote @XtrmJosh's lame ass tutorial but there is one or two on Youtube.

  8. #18
    XenoBot Scripts Developer Joshwa534's Avatar
    Join Date
    May 2012
    Location
    Texas, USA
    Posts
    4,890
    Mentioned
    517 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by XtrmJosh View Post
    Can you guys stop being idiots and focus on the question in hand: @Rydan @Nakuu.

    The OP states that the script is walking back and forth. If the scripts were badly written, based on the information @DarkstaR provided us with in the update thread, the only thing that will be different is that the walker may wait for longer than is necessary, or just not restart after a label. It would not lead to this kind of issue. So, stop throwing insults at people, and start doing something productive. From where I'm standing, all I can see is people sucking up to DarkstaR and trying to insult other people, not knowing who they are in fact insulting.

    @inadequate - Are you able to post the lua file somewhere? Or is it a paid for script? If it's paid for, contact the vendor, otherwise, post the Lua file and I will take a look and see if I can spot the error. It would also be handy if you could post it on www.pastebin.com, that way I can view it from my tablet and respond on the bus tomorrow.
    You aren't sucking up to someone?

    Quote Originally Posted by XtrmJosh View Post
    You can drop me a PM if you like and if it's something I he will approve of discussing I can get you a reply
    I need a secretary like you, wanna come work for me?

  9. #19
    Senior Member
    Join Date
    May 2013
    Posts
    659
    Mentioned
    27 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by XtrmJosh View Post

    Code:
        print([[
        Yalahar Minotaurs or Elves by Xiaospike & Joshwa534]])
        wait(5000)
    Why do you insert a 5 second wait after starting the script? This raises a couple of issues, not least being that if in your first couple of waypoints you happen to have a label, it will be ignored. This poses a potential risk to the end user, and is a complete waste of a thread.
    It is to avoid having the first label ignored.


    Quote Originally Posted by XtrmJosh View Post
    Code:
    		local withdrawManas = math.max(MaxMana - Self.ItemCount(268), 0)*50
    		local withdrawHealths = math.max(MaxHealth - Self.ItemCount(266), 0)*45
    		local withdrawAmmo = math.max(MaxAmmo - Self.ItemCount(7378), 0)*15
    		local totalmoneyneeded = (withdrawManas + withdrawHealths + withdrawAmmo)
    		local MATHCEIL = (math.ceil((totalmoneyneeded/1000)))*1000
    OK, so this is a large chunk to comment on. Firstly, it's ugly as hell. A much more organised way to do this would be to make a function and name it CalculateItemCost, pass in a variable for amount to buy, item ID, and cost per item, then perform these calculations and return the value. It looks shit, and is difficult to debug as a result. Secondly, why would you attempt to truncate a number in such a way? As you are simply rounding, you could use the function math.round. Sure, math.ceil will do the same job, but it once again makes code unreadable and difficult to debug.
    Afaik, there's no math.round function? You are probably thinking of math.floor, while math.floor rounds down in an old fashion, math.ceil rounds up.


    Quote Originally Posted by XtrmJosh View Post
    Code:
    		if (LogoutStamina) and (Self.Stamina() < 960) then

    It seems very unintuitive to assume that an end user wants to log out with 2 hours remaining. A round of most hunts for me is much less than an hour, another thing which would be beneficial to have as a variable. On top of that, here's your fourth naming convention. Well done. Include a fifth next time for a free gift voucher!

    What's the problem? If you'd like to hunt for only one hour, get back to your computer and logout.

    Quote Originally Posted by XtrmJosh View Post
    Code:
    function SellItems(item) -- item = item ID
    	wait(300, 1700)
    	Self.ShopSellItem(item, Self.ShopGetItemSaleCount(item))
    	wait(900, 1200)
    end
    Wait, buy, wait? Why not use a convention? Why waste time waiting before and (sometimes) after every function, when you could just be waiting before every function? I think I know the answer you're going to give (if any), and I suspect you will say something like "we did that incase someone else tries to copy this code, so they won't risk getting banned by doing shit too quickly", but then again there is a large part of me that suspects that you didn't even write this code, so meh.

    Code:
    function BuyItems(item, count) -- item = item id, count = how many you want to buy up to
    	wait(900, 1200)
    	if (Self.ItemCount(item) < count) then
    	Self.ShopBuyItem(item, (count-Self.ItemCount(item)))
    	wait(200, 500)
    	end
    end
    This one is quite strange... Why would your first wait be outside of the if statement, and your second inside? It makes no sense. Then again, based on the code I've reviewed so far, it seems that your primary "company principle" is something like "If there is nothing else to do, wait." Good one. After reviewing this post, it's also just come to my attention that in fact you are waiting a bit, then this function is called, then it's waiting some more, then it's doing something, then waiting some more, then waiting some more again, then it's gonna do something else. Yeah, it's semi-random (primarily because this piece of code is not designed to have wait calls before and after it), but fuck me it's wasteful.

    And here's the random waits you wanted earlier when buying potions or ammo.

  10. #20
    Banned
    Join Date
    Apr 2012
    Location
    Little Red Dot
    Posts
    2,957
    Mentioned
    204 Post(s)
    Tagged
    0 Thread(s)

Posting Permissions

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