• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

How to make my raids spowns automaticly?

NilssoN042

Banned User
Joined
Sep 8, 2008
Messages
998
Reaction score
2
Location
Sweden, Helsingborg
This is maybe a newbie question but how do I make them spawn automaticly?
I think it have something to do with interval2 but I dont know

Here is my raids.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<raids>
	<raid name="Barbarian" file="Barbarian.xml" interval2="30" margin="1800" enabled="yes"/>
	<raid name="Demodras" file="Demodras.xml" interval2="35" margin="1800" enabled="yes"/>
	<raid name="Elfs" file="Elfs.xml" interval2="30" margin="1800" enabled="yes"/>
	<raid name="Ferumbras" file="Ferumbras.xml" interval2="60" margin="1800" enabled="yes"/>
	<raid name="Necropharus" file="Necropharus.xml" interval2="30" margin="1800" enabled="yes"/>
	<raid name="OrcsThais" file="OrcsThais.xml" interval2="30" margin="1800" enabled="yes"/>
	<raid name="Orshabaal" file="Orshabaal.xml" interval2="45" margin="1800" enabled="yes"/>
	<raid name="Pirates" file="Pirates.xml" interval2="30" margin="1800" enabled="yes"/>
	<raid name="Quara" file="Quara.xml" interval2="30" margin="1800" enabled="yes"/>
	<raid name="Rats" file="Rats.xml" interval2="30" margin="1800" enabled="yes"/>
	<raid name="Scarabs" file="Scarabs.xml" interval2="30" margin="1800" enabled="yes"/>
	<raid name="The Old Widow" file="The Old Widow.xml" interval2="35" margin="1800" enabled="yes"/>
	<raid name="UndeadDarashia" file="UndeadDarashia.xml" interval2="30" margin="1800" enabled="yes"/>
	<raid name="UndeadArmy" file="UndeadArmy.xml" interval2="30" margin="1800" enabled="yes"/>
	<raid name="Wolfsraid" file="Wolfsraid.xml" interval2="25" margin="1800" enabled="yes"/>
	<raid name="Necropharus" file="Necropharus.xml" interval2="30" margin="1800" enabled="yes"/>
	<raid name="Hornedfox" file="Hornedfox.xml" interval2="30" margin="1800" enabled="yes"/>
	<raid name="Halloweenhare" file="Halloweenhare.xml" interval2="40" margin="1800" enabled="yes"/>
	<raid name="Dryads" file="Dryads.xml" interval2="40" margin="1800" enabled="yes"/>
	<raid name="Undead Jester" file="Undead Jester.xml" interval2="40" margin="1800" enabled="yes"/>
	<raid name="goblin" file="grynch clan goblin.xml" interval2="40" margin="1800" enabled="yes"/>
	<raid name="Morgaroth" file="Morgaroth.xml" interval2="40" margin="1800" enabled="yes"/>
</raids>
 
a globalevent.
LUA:
local storage = 1344
local raids = {
	"Raid1", "Raid2", "Raid3", "Another Raid", "the last raid"
}

function onThink(interval, lastExecution, thinkInterval)
	if getGlobalStorageValue(storage) == -1 or getGlobalStorageValue(storage) < os.time() then
		executeRaid(raids[math.random(1, #raids)])
		setGlobalStorageValue(storage, os.time() + 9 * 60 * 60)
	end
	return TRUE
end
 
Code:
interval2="6000" chance="5"
Interval 6000 = 6 seconds
Chance = 5%

So every 6 seconds, there is a 5% chance for the raid to come.

I think 6000 = 6 seconds, could be 6 minutes. I'm not sure
 
it was sth like time after last raid before this one can appear or maybe time after this raid before another can appear or sth like that, but I'm not sure
 
margin is how far apart each raid can be. Say Raid A goes off...then Raid B was gunna go off 3 minutes later, but if your margin is set to 10 minutes then it wont.
 
I have changed margin to 0 on all raids.

<?xml version="1.0" encoding="UTF-8"?>
<raids>
<raid name="Barbarian" file="Barbarian.xml" interval2="14000" chance="40" margin="0" enabled="yes"/>
<raid name="Demodras" file="Demodras.xml" interval2="7000" chance="95" margin="0" enabled="yes"/>
<raid name="Elfs" file="Elfs.xml" interval2="28000" chance="40" margin="0" enabled="yes"/>
<raid name="Ferumbras" file="Ferumbras.xml" interval2="28000" chance="80" margin="0" enabled="yes"/>
<raid name="Necropharus" file="Necropharus.xml" interval2="7000" chance="96" margin="0" enabled="yes"/>
<raid name="OrcsThais" file="OrcsThais.xml" interval2="56000" chance="70" margin="0" enabled="yes"/>
<raid name="Orshabaal" file="Orshabaal.xml" interval2="50000" chance="50" margin="0" enabled="yes"/>
<raid name="Pirates" file="Pirates.xml" interval2="28000" chance="35" margin="0" enabled="yes"/>
<raid name="Quara" file="Quara.xml" interval2="35000" chance="25" margin="0" enabled="yes"/>
<raid name="Rats" file="Rats.xml" interval2="18000" chance="70" margin="0" enabled="yes"/>
<raid name="Scarabs" file="Scarabs.xml" interval2="14000" chance="45" margin="0" enabled="yes"/>
<raid name="The Old Widow" file="The Old Widow.xml" interval2="7000" chance="70" margin="0" enabled="yes"/>
<raid name="UndeadDarashia" file="UndeadDarashia.xml" interval2="56000" chance="40" margin="0" enabled="yes"/>
<raid name="UndeadArmy" file="UndeadArmy.xml" interval2="65000" chance="40" margin="0" enabled="yes"/>
<raid name="Wolfsraid" file="Wolfsraid.xml" interval2="10000" chance="60" margin="0" enabled="yes"/>
<raid name="Hornedfox" file="Hornedfox.xml" interval2="7500" chance="80" margin="0" enabled="yes"/>
<raid name="Halloweenhare" file="Halloweenhare.xml" interval2="40" margin="0" enabled="yes"/>
<raid name="Dryads" file="Dryads.xml" interval2="40" margin="0" enabled="yes"/>
<raid name="Undead Jester" file="Undead Jester.xml" interval2="40" margin="0" enabled="yes"/>
<raid name="goblin" file="grynch clan goblin.xml" interval2="40" margin="0" enabled="yes"/>
<raid name="Morgaroth" file="Morgaroth.xml" interval2="86000" chance="25" margin="0" enabled="yes"/>
</raids>

Will it make the raids spown auto?
 
Easy.

globalevents.xml

Code:
	<globalevent name="raid" interval="1500" event="script" value="raids.lua"/>

globalevents/scripts/raids.lua

Code:
local storage = [COLOR="Red"]1344[/COLOR] -- [COLOR="SeaGreen"]change'able[/COLOR]
local raids = {
	"Example1",
	"Example2"
}

function onThink(interval, lastExecution, thinkInterval)
	if getGlobalStorageValue(storage) == -1 or getGlobalStorageValue(storage) < os.time() then
		executeRaid(raids[math.random(1, #raids)])
		setGlobalStorageValue(storage, os.time() + 9 * 60 * 60)
	end
	return TRUE
end
 
Easy.

globalevents.xml

Code:
	<globalevent name="raid" interval="1500" event="script" value="raids.lua"/>

globalevents/scripts/raids.lua

Code:
local storage = [COLOR="Red"]1344[/COLOR] -- [COLOR="SeaGreen"]change'able[/COLOR]
local raids = {
	"Example1",
	"Example2"
}

function onThink(interval, lastExecution, thinkInterval)
	if getGlobalStorageValue(storage) == -1 or getGlobalStorageValue(storage) < os.time() then
		executeRaid(raids[math.random(1, #raids)])
		setGlobalStorageValue(storage, os.time() + 9 * 60 * 60)
	end
	return TRUE
end

Do I have to use a globalevent if my raid.xml looks like it does right now?

and then what "storage" should I use. Can I use the one that is already written?
 
Do I have to use a globalevent if my raid.xml looks like it does right now?

and then what "storage" should I use. Can I use the one that is already written?

Yes, use the storage that's already written. But remember storages only can be used once. Where the examples are you write the raids you have at the moment. What this script does is that it's executing a raid every "globalevent time" automatically, exactly as you would write "/raid <raidname>" but, this script does it for you.

Note; Write all of your raids in the example list. Remember the "," afterwards before the last one.

Code:
raid,
raid,
raid,
raid,
raid

Like that. Good luck
 
Back
Top