I forgot who the original poster and where i got it from if anyone knows tell me and i will give proper credit. (This is same copy i got originally, I haven't edited it yet)
Random Combat Generator:
UseLib("def.js");
function OnEnter(){
i = Rnd(1,3); //a random number from 1 to 3
if ( i == 1){
AddContent(6001001,1001004,3,0); //add three rats
EnterCombat();
}
else if ( i == 2){
AddContent(6001004,1001004,2,0); //add two spiders
EnterCombat();
}else{
//do nothing here
}
return true;
}
function OnExit(){
foreach(4,"AlterVisibility(Current.ID,false);");
}