Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: General questions, help needed!

  1. #1
    Normal User
    Join Date
    Jul 2012
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5

    General questions, help needed!

    Hey, instead of PMing a few people to get the answers, maybe it will look less 'annoying' and more helpful to others if I just post my question in here...

    Mount
    is there to mount up through a command/actions? I know there is the auto-mount but that isn't so helpful for my needs

    What does the 3rd parameter in buyitemsupto do?
    PHP Code:
    buyitemsupto(string itemint amountoptional int currentamount
    Why is my "tosec" returning 0 no matter what?
    PHP Code:
    addtext(total.." GPs ("..(math.floor((total/(tosec(timehunt)/3600))/100)/10).."k/h)"50y
    It is returning "Infinity" because it is trying to divide by 0 ><

    Is it possible to make "dropitems" function to also consider amount of items? (ie: drop only x)

    What does "category" in monster settings do?
    Last edited by Daewe; 07-20-2012 at 05:01 AM.

  2. #2
    Normal User wicholost's Avatar
    Join Date
    Jun 2012
    Location
    Jamaica, Chile
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    14
    Rep Power
    5
    1.
    buyitemsupto(string item, int amount, optional int currentamount)
    item = item name or id
    amout = the amount of supplys u want to buy
    currentamout = mean how many supplys you have at the moment

    2.
    you should check the timehunt var since it has to be on time format. also you can use the Raphael Library to convert it to a valid time.

    3.
    Its a way to setup a targeting mode for the category insteat of a single monster.

    example: category a;b

    Rat=a
    Spider=a
    Wolf=b

    (this's not a action just a way to explain the targeting)

    if category a > 3 then melee circle
    if category b > 2 then lure

    etc.

  3. #3
    Normal User
    Join Date
    Jul 2012
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    1.
    Well, that I gotcha but doesn't the function do it automatically? ie, if I have 10 mana potions and I use buyitemsupto to buy 50, it will only but 40 anyway, so what is the deal with the 3rd parameter?

    2.
    Time hunt is returning 12:00:00 AM and then increasing as the time passes by, so yea, it is on time format and "tosec" function is still returning 0

    3.
    Thanks!

  4. #4
    Normal User ScripterBR's Avatar
    Join Date
    Jul 2012
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    10
    Rep Power
    5
    Nice, ty

    i used and

  5. #5
    Normal User
    Join Date
    Jul 2012
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    Well, I made some advances about figuring out why my tosec(timehunt) isn't working...
    I found out that timehunt also returns AM/PM, in which case, is bugging out tosec()
    If it only returned the time hh:mm:ss it would work.. >.>

    edit:
    Ok, I figured it out completely
    Depending on how your windows is set to show its clock (hh:mm tt OR hh:mm only) it will make the function tosec() useless since it will bug out, returning only 0, because it doesn't explode the string to remove the AM/PM part and thus doesn't understand what that time string is supposed to mean.
    Workaround: control panel -> region and language -> short time/long time -> make your windows to show its clock in hh:mm manner.
    Last edited by Daewe; 07-20-2012 at 09:57 PM.

  6. #6
    Normal User wicholost's Avatar
    Join Date
    Jun 2012
    Location
    Jamaica, Chile
    Posts
    114
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    14
    Rep Power
    5
    1 well the 3rd parameter its useless anyway. this is a example of how the function works:

    local mananame = 'mana potion'
    local maxmanas = '1000'

    if itemcount(mananame) <= maxmanas then
    buyitemsupto(mananame, maxmanas)
    wait(1000,1500)
    end

    2. you may rewrite the function using tokens to identify the am/pm case!
    Last edited by wicholost; 07-20-2012 at 09:57 PM.

  7. #7
    Normal User FrogZ's Avatar
    Join Date
    Jul 2012
    Location
    Laguna Island - LB
    Posts
    239
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    14
    Rep Power
    5
    Quote Originally Posted by Daewe View Post
    Hey, instead of PMing a few people to get the answers, maybe it will look less 'annoying' and more helpful to others if I just post my question in here...

    Mount
    is there to mount up through a command/actions? I know there is the auto-mount but that isn't so helpful for my needs

    What does the 3rd parameter in buyitemsupto do?
    PHP Code:
    buyitemsupto(string itemint amountoptional int currentamount
    Why is my "tosec" returning 0 no matter what?
    PHP Code:
    addtext(total.." GPs ("..(math.floor((total/(tosec(timehunt)/3600))/100)/10).."k/h)"50y
    It is returning "Infinity" because it is trying to divide by 0 ><

    Is it possible to make "dropitems" function to also consider amount of items? (ie: drop only x)

    What does "category" in monster settings do?
    If you give ToadZ his credits i tell you why its returnning infinite

  8. #8
    Normal User
    Join Date
    Jul 2012
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    I only control C/V his action line because I know for a fact it would be a working one, like, if I posted a action of mine it would NOT be working because I made something dumb rather than my actual problem showing up (aka, tosec() not working), so to try to avoid that, I simply copied a line from someone who knows what hes doing.

    Also, I don't get this "give credit" for most of what people bring up to these forums, I would understand if it was something really big but for some actions/easy stuff it is just.... un-needed to give credit.
    I talked to ToadZ through PMs so he could help me with some doubts and he was a really nice guy, but don't get me wrong, giving credits to someone who figured out why 2+2 = 4 before me is just... beyond me

    Thanks for your willingness to help me, even tho I already found out what was causing the error.
    Last edited by Daewe; 07-20-2012 at 10:19 PM.

  9. #9
    Normal User FrogZ's Avatar
    Join Date
    Jul 2012
    Location
    Laguna Island - LB
    Posts
    239
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    14
    Rep Power
    5
    well since he worked hard to do that HUD i think he deserve a little credit...

    Click image for larger version. 

Name:	adasdlo.jpg 
Views:	14 
Size:	27.2 KB 
ID:	4397

    well check this picture. you just need to enable actions and it will work... if it doest work you should check what "total" is returning bcuz the problem is with the variable "total".

  10. #10
    Normal User
    Join Date
    Jul 2012
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quoted
    0 Post(s)
    Reputation
    11
    Rep Power
    5
    I searched for the term "tosec" and "timehunt" and "gold hour" to see, and I ended seeing some posts of his (ToadZ) saying to enable actions and that would make it work, unfortunately, it didn't help me.
    Some posts above (by me, in this very same thread) I found out why tosec() wasnt working..
    I think this bot was made in mind with brazilian settings, which means, tosec() was expecting to analyze only a string made only of numbers, but since I have AM/PM clock (american standarts, as opposed to br standarts of HH:MM only) on my windows, it wasn't working properly.
    I did the workaround and now it is working, just wanted to say that the actions alone doesn't make the tosec working.

    source: try by yourself switching around the way your clock shows up, you need to re-open the bot to make it use the new settings.

    Again, thanks even tho that wasn't the problem ><

    Btw FrogZ, do you have any idea of how to make my toon mount up through actions? (the auto-mount implemented in the bot doesn't fit my needs QQ)
    thanks in advance

Posting Permissions

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