ID:1148712
 
Keywords: events, number, problems
(See the best response by Dariuc.)
Code:
lastevent=pick(0,1,2,3,4,5)
if(lastevent==0&&!eventon)
//rest of event info
if(lastevent==1&&!eventon)
//rest of proc
if(lastevent==2&&!eventon)
//rest of proc
if(lastevent==3&&!eventon)
//rest of proc
if(lastevent==4&&!eventon)
//rest of proc
if(lastevent==5&&!eventon)
//rest of proc


Problem description:

I have an event proc that cycles through events depending on what the last event was. It used to work, but now I want the events to be random
Best response
This could be improved a bit:
lastevent=pick(0,1,2,3,4,5)
if(eventon)
switch(lastevent)
if(1)
if(2)
if(3)
if(4)
if(5)
//and so on


However that doesn't really state what your problem is. Could you be more specific?
I think he's trying to do something like this:
proc/newEvent()
var/event = rand(0,5)
if(!eventon) switch(event)
if(0)
//etc...
if(5)
In response to Super Saiyan X
@Dariuc, SSX
1. lastevent is in [0, 5], so either pick(0, 1, 2, 3, 4, 5) or rand(5) gets that.
2. It's !eventon.

@Critical
Your code should work as-is, although they've just been providing simpler and cleaner ways to accomplish the same thing. What are you actually asking for here?
In response to Super Saiyan X
Super Saiyan X wrote:
I think he's trying to do something like this:
> proc/newEvent()
> var/event = rand(0,5)
> if(!eventon) switch(event)
> if(0)
> //etc...
> if(5)
>

good catch thanks.
I just found out that none of my world procs are working
world
New()
shiban()
MaskDrain()
ADrain()
ShunDrain()
bootboosts()
AFK_Checker()
M_Machine()
Hollow_Spawn()
Start_Lost_Zan_Event()

Is there a way to fix
No clue what all of those do.
You are obviously rather new at this- my advice would be to take some time and get familiar with what you are doing before you try to tackle more advanced coding. In the long run that will help you best.

As for how to fix your problem, do you get any errors?
No errors. I've been using these codes for awhile, but it doesn't work anymore. It's weird
In response to Critical172
Try adding ..() under the New() before you run any of the procs. You're overriding world/New() and not calling back to actually create the world.

Also, you have a few poor programming habits. I'd suggest looking back over the guide and working on condensing your code.
In response to Kumorii
Of course, world/New() is just a blank event that's called after the world has been created (like atom.New()), and doesn't have a default action. The problem is still probably caused by leaving out ..() in (a different) world/New() override, though.
lol I found out why. I added a loop in one of those procs by accident.
srry for all the trouble.