Name: Colour High Alcher
What it does: Casts High Alchemy on noted items
Where does it do this: Any safe area
What does the script achieve: Magic XP
Requirements: 55 Magic
Note: I have a general idea of the program flow. I'm not proficient in SIMBA programming at all. Looking for someone to work with.
Code:
/**
* Assumptions:
* 55 Magic
* Fire Staff Equipped
* Start in spellbook
* At least 1 nature rune and 1 noted item in start
* Neccessary:
* Nature rune in row=0 col=0
* Noted items in row=3 col=3
*
* Note:
* castHighAlch() must ensure quantities of both (0,0)
* and (3,3) are greater than 1 to ensure next spell can
* be cast OR castHighAlch() checks the colour of the spell.
* castHighAlch() returns !0 if spell was not cast.
*
*
*
* Concerns:
* Wait time is uniformly generated. Perhaps use
* box-muller for a normal distribution.
*
*/
#define ALCH_TIME 3 //Seconds
#define MAX_WAIT 2e9 //Nanoseconds
int
main(void)
{
struct timespec ts;
ts.tv_sec = ALCH_TIME;
ts.tv_nsec = 0;
srand(time(NULL));
while (1) {
ts.tv_nsec = rand() % (MAX_WAIT + 1);
nanosleep(&ts, NULL);
if (castHighAlch())
break;
}
return 0;
}
Edit:
I forgot that setting tv_nsec above 1 second results in undefined behaviour. Easy adjustment there, just need to use quotient and remainder.
Planning to mess around with Dan's script to get this running.