Daily farming script

BigH

New member
Basically, this is my first ASH script for KoLMafia, and i was wondering if someone could give it a quick once-over to check for any bugs that i might have missed. It should be pretty easy to work out what it does, its commented as well.
 
Code:
while (have_effect(Ode to Booze) = 0) {
should be:
Code:
while (have_effect($effect[Ode to Booze]) == 0) {
once fixed:
Code:
while (have_effect($effect[Ode to Booze]) == 0) {
	wait(2);
}
will enter an infinite loop.
Code:
while (have_effect($effect[Ode to Booze]) == 0) {
	wait(2);
        cli_execute("effects refresh");
}
is the fix.

Code:
  while (have_effect(Carlweather’s Cantata of Confrontation) = 0 && over240 == false) {
  	wait(2);
  }
Code:
while (have_effect(Carlweather’s Cantata of Confrontation) <= 240) {
  		wait(2);
  	}
same issues as above.

There is a rule against posting scripts which purchase 1 a day buffs in this forum just for future reference.

a 2 second wait time is not long enough. I recommend a minimum 1 minute wait time. I figure you may have meant to wait 2 minutes? If so
Code:
wait(120);
is what you are wanting.

I believe a comment line must have 2 # signs at the beginning, not just 1.

finally, If the buffbot is down, your script will wait forever. visit this thread for more info, and how to fix it.

I think that is all, however once fixed the only way to know for certain is to try it. The best way is to start kolmafia (don't login) and run the script. Read any messages displayed. Kolmafia will display an error message if there is a problem. You only need to realize whether it is saying something is wrong with the script, or it is failing because of not being logged in.
 

BigH

New member
Thanks for the comments/fixes, helped a lot :)

Thanks for the link, although i think i will leave it looping. I often set the farmers off before i go out somewhere, and the chances of it taking a long time is nigh on zero. I will however increase the waiting time to about 30 seconds to stop server hits being too high.

I will remove the script now, dnt wanna break any rules.

Is there a way of buying items in the mall up to a certain price? If not, i will try and create a way to do it using the current commands if there isnt a function built in.
 
[quote author=BigH link=topic=700.msg3268#msg3268 date=1168460671]
Is there a way of buying items in the mall up to a certain price? If not, i will try and create a way to do it using the current commands if there isnt a function built in.
[/quote]

The problem with functions like that is they would allow mallbots. Holatuwol is totally against the idea of his program being used for mallbot purposes, and has put several stops in place to prevent it.
 

BigH

New member
What i was thinking, was to buy 1 of an item, check the new meat total against the old meat total (before purchase) and if it less than x amount difference, then buy another one.
 

BigH

New member
Why? I want it to check for any yeti fur below the bounty price for hippo skins and buy them all. Whats wrong with that?
 

Nightmist

Member
[quote author=BigH link=topic=700.msg3272#msg3272 date=1168472799]
Why? I want it to check for any yeti fur below the bounty price for hippo skins and buy them all. Whats wrong with that?
[/quote]
Because thats mallbottish and buying 1 at a time isn't server friendly either, asshattish behavour really. So don't do this, and if you do, then don't post it in here.[/flamey opinion]
 
[quote author=Nightmist link=topic=700.msg3274#msg3274 date=1168485576]
Because thats mallbottish and buying 1 at a time isn't server friendly either, asshattish behavior really. So don't do this, and if you do, then don't post it in here.[/flamey opinion]
[/quote]
mallbottish my ass! That is just plain a mallbot!

Reason #1 Holatuwol doesn't want his program used to do such things.
Reason #2 You and your entire clan will end up on everyone's baleet list.
Reason #3 do you want to keep your account? Well the MultiCzar and Jick will disable it if you do that.

I could go on forever.
 

Nightmist

Member
[quote author=efilnikufecin link=topic=700.msg3275#msg3275 date=1168487419]
mallbottish my ass! That is just plain a mallbot!
[/quote]
I would agree if only it didn't require the purchase of a item first before being able to determine if a item is under a certain value. (There is actually a few ways to bypass the actual buying but he never stated any of them so I assume he didn't think of them or doesn't know how to use them). In other words hes screwed if someone buys up prices as he runs that script. Then again we probably have different definitions of what would qualify as a "mallbot", some would say the simple price gathering bots are mallbots since they hit the mall so many times so meh. (Not to mention he will probably only run this after his faming script, whereas I think of a mallbot as more of a constant hittage, I mean if he runs it constantly in loop hes going to be buying up a lot of yeti furs... probably priced at hippo autosell x2 so he breaks even but then his script then made much easily screwed by market manipulation again)
 

BigH

New member
Didnt realise that this would be quite so frowned upon. And it is not a mallbot. That is something that would be on constantly, refreshing the mall search page for item x every y seconds and purchasing any item x under a certain value. That is not what this does.

Why would i be on peoples baleet lists?
Why would i be disabled? (that seemed a very stupid remark to me, cant see how it breaks any rules)

Just to make it clear i wont be making this, because it is so frowned upon, but i would still like answers to those questions, just for curiosity purposes.
 

Nightmist

Member
[quote author=BigH link=topic=700.msg3278#msg3278 date=1168503678]
Didnt realise that this would be quite so frowned upon. And it is not a mallbot. That is something that would be on constantly, refreshing the mall search page for item x every y seconds and purchasing any item x under a certain value. That is not what this does.
[/quote]
Because if you looped that yeti purchasing script it WOULD be a mallbot? (You never did specify when you were going to run that script, and when you leave it as "I want to buy X item when under Y price" it's not suprising one will assume mallbot)
 

macman104

Member
I would personally after the script is done running, take the 2 minutes it would take to do a search for "yeti fur" in the purchases frame, and simply buy as many as you want through that.
 
My most basic description of a mallbot...

A program running a character buying items from the mall or flea market to resale for profit.

[quote author=BigH link=topic=700.msg3278#msg3278 date=1168503678]
Why would i be on peoples baleet lists?
Why would i be disabled? (that seemed a very stupid remark to me, cant see how it breaks any rules)
[/quote]

Simple in both cases. I put 50,000 yeti furs in my store for 184 meat each. You hit my store 50,000 times buying them 1 at a time when you could just buy them all in one shot. 50,000 is ridiculous I know, but let's go with that number.

The buying of 50,000 yeti furs 1 at a time would require 50,000 server hits (if there is no re-direct). Because you would be saying "buy(1, $item[yeti fur]);" each time, kolmafia would search the mall each time. Another 50,000 server hits(if there is no re-directs). That's 100,000 server hits for what is it? 12 meat profit each 2 server hit? Or 6 meat per server hit? If I saw something that severe happening in my store I would baleet you. I'm betting there are a lot of others out there that would too.

Now more reasonable would be 1000 yeti furs, 2000 server hits for just 12,000 meat total profits. If someone did put 50,000 of them in their store and you bought them like that my money says that Jick and company wouldn't like the 100,000 server hits, and your account would get disabled.

Sorry for having an asshat like response earlier. I really try to be as friendly as possible, but fail to realize that often people just don't realize the full possibilities of what they are wanting.
 

BigH

New member
Comments heeded :) and apologies accepted. I don't mean to harm KoL, i love this game :)

A bug has occurred with the script. Says " ')' expected at line 33 of..... "

Code:
  while (have_effect($effect[Carlweather’s Cantata of Confrontation]) = 0 && over240 == false) {
  	wait(30);
	cli_execute("effects refresh");
  }

No idea what is wrong with it, although i expect it to be quite simple. Anyone help?
 

Nightmist

Member
[quote author=BigH link=topic=700.msg3289#msg3289 date=1168518625]
A bug has occurred with the script. Says " ')' expected at line 33 of..... "
[/quote]
Your missing a second "=" sign in your if... (Use "==" not "=")
 

BigH

New member
Just got that before checking here :) Thanks.

Surely it should give a different error message, because it is not missing a ')' it is missing a '='?
 

BigH

New member
I understand that, but i dont understand what it has to do with missing parenthesese (sp)

Im a computer science student, so it probably goes outside the scope of mafia scripting, but it would be interesting to know.
 

Nightmist

Member
[quote author=BigH link=topic=700.msg3295#msg3295 date=1168520706]
I understand that, but i dont understand what it has to do with missing parenthesese (sp)

Im a computer science student, so it probably goes outside the scope of mafia scripting, but it would be interesting to know.
[/quote]
I always just figured it saw the "=", goes "ohhh so the stuff before was a variable and the following will be the value"... then "Wait, wtf, its got 2 open parentheses and only 1 closing parentheses", then "zomg throw a error saying they need another closing parentheses".
Just a guess though.
 
Code:
  while (have_effect($effect[Carlweather’s Cantata of Confrontation]) = 0 && over240 == false) {
  	wait(30);
	cli_execute("effects refresh");
  }

at the point in which the error happens..the "=" sign kolmafia expects "==" or ">=" or "<=" or "&&" or ")" or "))" is that all of them?
the message could say
"==" or ">=" or "<=" or "&&" or ")" or "))" expected
but a quick glance simply leads to more confusion, and it could be quite a mess if the nesting got very deep.

Kolmafia is saying close all "(" with ")" before assigning values to variables at line ##. heh that might be a better error message. I wonder how difficult that message would be to put in instead of ")" expected. A variable assignment is what kolmafia sees.
 

BigH

New member
Ahh i understand it better now. I am wondering if Mafia is parsing the error thrown by java, and inserting it into the display line, as it is similarly written in jav if i remember correctly.

Thanks a lot for all ur help guys, i really appreciate it, especially efiln :)
 
Top