25 May, 2011, galius wrote in the 1st comment:
Votes: 0
I had originally installed the rom hack of mpsleep by Jason De Leon some time ago and it works when your using it in progs without if/else. When you do use mpsleep in an if/else statement it just ignores them altogether and fires the whole program. For the life of me I could never figure out how to fix it and then I saw recently that Bardock had posted another version of mpsleep based of Jasons that I had hoped had resolved the problems (found here so I downloaded a stock rom 2.4 with olc and put it in.

Install instructions were very clear and concise and it went in with no problems, however once I started the game up I had the same problem with his version as I had with the other. If anyone could spare a few minutes of their time to perhaps download a stock rom with olc, stick Bardock's snippet in and see if you experience the same problems I'm having I would thoroughly appreciate your time and effort.
25 May, 2011, galius wrote in the 2nd comment:
Votes: 0
Just a follow up since I apparent forgot to add this. In the original version of the rom hack of mpsleep by Jason De Leon it just skips over if/else and executes the whole progs. For example:

if level $n < 5
say Welcome to newbie school!
sleep 5
say Enjoy your stay.
else
say Sorry, your too high of a level to be in newbie school
endif


So in Jasons version it'll just end up doing all three says, ignoring if if check completely. Now that same prog in Bardocks version crashes the game on a stock 2.4 rom not sure how I didn't notice that before, lol.
01 Jun, 2011, Hades_Kane wrote in the 3rd comment:
Votes: 0
Take a look at this code and see if it might work better for you. We use it a lot in mob progs, although I can't recall off hand how it works alongside if checks:
http://www.mudbytes.net/file-684
02 Jun, 2011, Ssolvarain wrote in the 4th comment:
Votes: 0
What Hades_Kane linked works perfectly fine inside an if statement for mprogs.

if vnum $n 9999
delay 5 say I'm only sleeping…
else
delay 1 say Please don't be long…
endif



The only real catch is that if you put two commands like
if vnum $n 9999
delay 5 say I'm only sleeping…
delay 5 snore
endif


it will execute the snore THEN the say. You just have to remember that if you want multiple things to happen at once in a certain order.
13 Aug, 2011, Bojack wrote in the 5th comment:
Votes: 0
Hey galius, thanks for posting that. The link to the mpsleep is actually old, my problem is ill have spurts of coding idea's and fixes then ill stop because of boredom. After looking at that code and whats actually in the mud is slightly different, even my install file looks exactly the same as that post so I guess I got lazy and never posted the fix for the crash. You did however show me the if problem which ill try to fix and actually post it altogether later on.
15 Aug, 2011, Bojack wrote in the 6th comment:
Votes: 0
Btw galius, reason snore is executed first instead of the command say is in void interpret, skills and socials are checked first before doing a command.
15 Aug, 2011, Sharmair wrote in the 7th comment:
Votes: 0
Bojack said:
Btw galius, reason snore is executed first instead of the command say is in void interpret, skills and socials are checked first before doing a command.

Ah, no. The reason the commands set for the same time are executed in reverse order is
that a single-linked list like this is a last in first out data structure. When a new element
is added to the list, it is added at the head, moving the rest of the list down. Then when
it is read, it starts at the head and moves down, executing the last stored first.

It should be noted here that the delay system talked about here is not the same thing as
a wait/mpsleep system and though it might be able to do some of the same things, it is
not a replacement for one. Also take note that the delay code has a couple bugs that
could cause it not to work, and leak memory.
15 Aug, 2011, Rarva.Riendf wrote in the 8th comment:
Votes: 0
If you want your mprogs to work as they look the easy way, go through the interpret method like any player (need to add a queue for commands for mobs as well though).
Then you wont have mobs able to cast 3 times in a round a spell a player would have 5 round to wait for as an example.
Or able to cast when they are muted etc etc etc…
16 Aug, 2011, Bojack wrote in the 9th comment:
Votes: 0
Some people want more then just mprogs though like me, i use sleep in all of them.
16 Aug, 2011, galius wrote in the 10th comment:
Votes: 0
Thanks for all the replies I had been away without net for a while. Happy to see you'll be looking into fixing it Bojack and thanks for the link Hades_Kane I'll look into it.
18 Dec, 2011, Bojack wrote in the 11th comment:
Votes: 0
Galius, ive started programming again this past week and I just fixed the sleep code to work for roms within if/and/else checks. The file is being approved right now but once it is, you'll have to go through it again. Ive tweaked it a lot and took out some lines I didnt need. Plus I made it for stock rom, not on a dynamic memory setting.
18 Dec, 2011, kiasyn wrote in the 12th comment:
Votes: 0
approved
0.0/12