errors

mmmk

New member
umm i got stuck on an error. says " '}' Expected at line 49 in file ... " when I try to run through mafia ...

could somebody please help me? i've been trying to figure out my problem for the last two days ...

oh and any constructive suggestions to my script would be appreciated.
 

Tirian

Member
The syntax error in your script is that you are trying to use // to start a comment instead of #.

My constructive suggestion about this script is that you don't run it ever.
 

macman104

Member
Am I correct in assuming that the two users are in the same clan? Is this a large clan, with many resources, or is it a clan comprised of mainly you? I'm not trying to make any assumptions, just trying to prevent you from being fingered for multi abuse. If you fall into the category of my clan includes me and my multi, then you'll likely be snagged for abuse. If your clan falls into the: we're a clan with a large number of resources, and these valuables are provided to us to share and use when we need them, then you may be ok. If this script isn't something that you run everyday, and run after ascensions or something, you might be a little safer (I say this, because our clan has many valuables that are allowed to be used for powerleveling and the like after ascensions, and I don't think we fear getting in trouble).
 

Nightmist

Member
[quote author=Tirian link=topic=293.msg1546#msg1546 date=1153181815]
The syntax error in your script is that you are trying to use // to start a comment instead of #.
[/quote]

// works as a comment, just dont have code to the left of it. (I tend to use // but falling into using # as a comment starter, not that I comment much in my scripts anyway)

As for constructive comments, yeah its probably better if this isnt being run everyday, the minor "Its just nice not to" use the "free" buffs everyday if its being run daily.

Oh and use can_eat() and can_drink() functions. Just to be safe though, and if your being safe, add some hardcore//ronin checks... unless your like knowing your never going to ascend and always just farm with them characters... in which case the clan taking of items and such may look a bit dodgy.
 

Veracity

Developer
Staff member
I would tend to do something like:

Code:
    boolean liver = have_skill($skill[liver of steel]);

rather than

Code:
	int liver;
	liver = 0;
	if (have_skill($skill[liver of steel]))
		{
		liver = 1;
		}
...
	if ( liver == 1 )

Booleans are your friend.

I don't understand why you are using cli_execute so much. Just about every single time you use it, you are duplicating a built-in ASH function. create, use, put_stash, take_stash, cast, equip... the list goes on. For example:

Code:
		cli_execute("cast " + int_to_string(leash) + "leash of linguini");

could just be:

Code:
		cast(leash, $skill[leash of linguini]);

And yes...this kind of script could very easily get you disabled for multi abuse. Let's hope you're in a big clan, rather than being in a clan of "me and my multis". :)
 

mmmk

New member
k. well actually my friend and i were in the same clan, so we were going to help run each others account.

is there a place with a listing of all the built in commands? I created mine based off of stuff I found looking through other scripts, which were probably created before there were built in commands ...

ah darn my power's goin out ...
 

macman104

Member
[quote author=mmmk link=topic=293.msg1559#msg1559 date=1153258339]is there a place with a listing of all the built in commands? I created mine based off of stuff I found looking through other scripts, which were probably created before there were built in commands ...[/quote]Funny you should ask, at the top of every single page there is a nice little paragraph with some bolded phrases pointing you to the scripting manual. You'll find all the information you need there.
 

Nightmist

Member
[quote author=macman104 link=topic=293.msg1565#msg1565 date=1153284981]
You'll find all the information you need there.
[/quote]
All minus anything undocumented, which actually is quite a bit >>. (It doesn't even have stash_take in the reference manual among other things) You should read the "scripting related" release notes that veracity has kindly posted for us in the "Scripting Discussion" section of this forums. They are usually named "Scripting changes in *VersionNumber*" and contain most of the undocumented commands that you will find.
 

holatuwol

Developer
Nightmist.  You've followed the project long enough to know that the complaint I despise most is when people point out that the scripting manual is incomplete, because it's clearly the part of KoLmafia where anyone can contribute, many people have promised to contribute, but nobody ever has, other than Xylpher.

Edit: Actually, forget it.  I've deleted the scripting documentation, along with all subcomponents of the manual other than the stuff to help you get started using the program. They'll be re-added if/when I ever feel like making them up-to-date again.
 

Nightmist

Member
[quote author=holatuwol link=topic=293.msg1567#msg1567 date=1153291498]
You've followed the project long enough to know that the complaint I despise most is when people point out that the scripting manual is incomplete, because it's clearly the part of KoLmafia where anyone can contribute, many people have promised to contribute, but nobody ever has, other than Xylpher.

Edit: Actually, forget it. I've deleted the scripting documentation.
[/quote]
Uhh... >> Well that was unexpected. Just so you know I wasn't making a complaint, I agree after re-reading my post now, that depending on the tone used it could be taken as a complaint but I was attempting to state that there are some missing commands in the documentation which if he wanted, look up in the posts made by veracity. I specifically made the comment on the "stash_take" function (I just realised I typo'ed that... ment to be "take_stash") because in this thread veracity makes a comment//question about why he didnt use the inbuilt function in his code, I was pointing out it isnt documented for him to know about it.

Hmm, well sorry for the offense I just want you to know it was intended as friendly banter.


PS. >> Does anyone have backups of the now non-existent page, if they do please could they host//send it to me?? (I assume the cached page google has could be out of date (4 Jun 2006 21:17:37 GMT) but if not then nevermind)
 

mmmk

New member
er sorry for any problems i've created. umm thanks to everybody for suggestions

i actually found the script help page quite useful. and i do go back and look for stuff in the manual.
 

holatuwol

Developer
Making a comment about incomplete scripting documentation for the KoLmafia project is a little like shouting "Fire" in a theater. While I (barely) tolerate it if it's someone who's brand new to the project, but if you've been around for a few releases, you should have seen the question pop up once on the main forums and seen me head-bite someone over it. I don't feel as though I have to provide documentation if it's easy enough to use (especially since documentation takes so long to produce), so I have zero tolerance ... just keep that in mind from now on.

All scripting documentation is now back online and the CLI manual is now up to date and possibly user-friendlier (six hours worth of moving data around ... ugh). I've deleted the ASH function reference, as it existed on the KoLmafia website, but I've merged the old reference with Xylpher's tutorial along with the tutorial on maps provided by Veracity here on these forums. I leave the actual ASH function reference project to the rest of you (team effort!), as I will no longer maintain it.
 

macman104

Member
I'll just say that I love the new organization of the manual. I think it's very neat, so however many hours of work you put into it, I personally think it was worth it. It looks good.
 
Top