How do I set different login / logout scripts for multis?

taltamir

Member
I have two seperate accounts on mafia. If I go to settings>automation there is a list of scripts there.
On login/logout script is shared between all my account, while the other 12 script choices are unique for each account. Is there a way to make login and logout script choices also unique for each account? I do not want to use the same script for both of them.
 

Veracity

Developer
Staff member
Stick code onto your login/logout script to look at your character name and do different things.
You may not want to use the same script, but, for now, it's what you have, so work around it.
 

taltamir

Member
Stick code onto your login/logout script to look at your character name and do different things.
You may not want to use the same script, but, for now, it's what you have, so work around it.
oh, that is a brilliant workaround!!!

... question, what command do I use to have 1 scrip call another script? ... actually, where would I find the documentation for the various available commands when writing a mafia script?
 
Last edited:

heeheehee

Developer
Staff member
Lazy way: cli_execute("call scriptname.ash");

Slightly less lazy way:
Code:
import <scriptname.ash>;
...
function_from_scriptname_ash();

To answer your other question, the wiki (linked at the top of these forums) is mostly complete (newer functions may be missing). The ashref command also provides links to said wiki.
 

heeheehee

Developer
Staff member
It's inefficient, makes debugging a pain (since you don't maintain the same call stack), you can't pass return values, and more.

It's akin to using eval in various languages.
 

taltamir

Member
It's inefficient, makes debugging a pain (since you don't maintain the same call stack), you can't pass return values, and more.

It's akin to using eval in various languages.
doesn't not maintaining the same call stack actually an advantage in terms of debugging?

Since each script is being run seperately via a CLI command, you should know exactly which script had the error. Whereas importing 20 scripts into 1 giant super script sounds like a way to make debugging harder.
 

heeheehee

Developer
Staff member
doesn't not maintaining the same call stack actually an advantage in terms of debugging?

Since each script is being run seperately via a CLI command, you should know exactly which script had the error. Whereas importing 20 scripts into 1 giant super script sounds like a way to make debugging harder.

I mean, that's what stack traces are for...
 
Top