[XP] RMXP Errors

Started by G_G, June 07, 2009, 06:54:11 pm

Previous topic - Next topic

G_G

RMXP Errors
Authors: game_guy
Version: 1.0
Type: Error Creating Script
Key Term: Misc System



Introduction

Makes funny errors for people to laugh at


Features


  • Makes funny errors for people to laugh at



Screenshots

N/A


Demo

N/A


Script

Spoiler: ShowHide

# Funny rmxp errors
pie = rand(10)
case pie
when 0
  e = "RMXP overloaded. All data was erased"
when 1
  e = "RMXP doesnt like being insulted. Erasing data"
when 2
  e = "RMXP doesnt like you, erasing all data"
when 3
  e = "RMXP ate chocolate there for erasing all data"
when 4
  e = "RMXP just got aids and is now erasing all data"
when 5
  e = "RMXP is now closing because he heard you call him gay"
when 6
  e = "RXMP is closing because Chuck Norris doesnt sleep, he waits"
when 7
  e = "????"
when 8
  e = "B==D"
when 9
  e = "(.Y.)"
when 10
  e = "RMXP just watched 2girls1cup and is now erasing all data."
end
raise(e)



Instructions

Paste into a new script


Compatibility

Not tested with SDK should work with everything

REPORTED ERRORS
Q: RMXP closed because he was called gay?? Does this have anything to do with your script?
A: No. It probably heard you call it gay. Thats your fault


Credits and Thanks


  • game_guy ~ for making it



Author's Notes

This is for entertainment only and therefor I posted it in Entertainment. As you can tell I needed some because I was bored out of my mind.

Sally


fugibo

June 07, 2009, 10:21:51 pm #2 Last Edit: June 07, 2009, 10:23:45 pm by WcW
Hmm. Why don't you try something more like this?

raise [ "err1", "err2", "err3", <etc>][rand(<length>)]

A whole lot simpler, and it would most likely be faster if Ruby had the option to use static arrays >_<

EDIT:
Oh, and BTW, to get RMXP to raise a specific kind of error (instead of just RuntimeError), use

raise <ErrorClass>, "<error message>"

ErrorClass is stuff like EOFError, ArgumentError, NoMethodError, etc

Blizzard

Who cares about details here.

WcW.disable_shutup_recovery
WcW.shutup

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Diokatsu

Quote from: WcW on June 07, 2009, 10:21:51 pm
Hmm. Why don't you try something more like this?

raise [ "err1", "err2", "err3", <etc>][rand(<length>)]

A whole lot simpler, and it would most likely be faster if Ruby had the option to use static arrays >_<

EDIT:
Oh, and BTW, to get RMXP to raise a specific kind of error (instead of just RuntimeError), use

raise <ErrorClass>, "<error message>"

ErrorClass is stuff like EOFError, ArgumentError, NoMethodError, etc

It's kind of like saying "Nice joke, but you can make that joke shorter by adding contractions." XD

fugibo

June 08, 2009, 12:19:38 pm #5 Last Edit: June 08, 2009, 01:11:38 pm by WcW
It would be even better if Ruby allowed this:

raise (a = File.read("./error_strings.txt").split("\n\n"))[rand(a.size)]

*goes to see if Ruby already has a random method for arrays*
EDIT Well, this method really sucks (horribly slow), but it does want I was looking for (somewhat):

raise [<errors>].sort_by{rand}[0]

Zeriab

I prefer the version presented since it's more clear for non-scripters.

Now if there are someone you don't like you can make something like this >:3
class Fun < rand < 0.99 ? Array : Hash
 # I am evil!
end


Guess what it does  :evil:

fugibo

Quote from: Zeriab on June 09, 2009, 04:31:59 pm
I prefer the version presented since it's more clear for non-scripters.

Now if there are someone you don't like you can make something like this >:3
class Fun < rand < 0.99 ? Array : Hash
 # I am evil!
end


Guess what it does  :evil:


What's so bad about subclassing Array/Hash...?

Zeriab

June 10, 2009, 04:46:42 am #8 Last Edit: June 10, 2009, 04:48:22 am by Zeriab
99% of the time when you run the code Fun is a subclass of Array.
The other 1% it is a subclass of Hash.

You can have code that works and suddenly it crashes! When you try it again it works.
Yay for apparent non-deterministic errors >:3

Blizzard

June 10, 2009, 05:35:44 am #9 Last Edit: June 10, 2009, 05:43:05 am by Blizzard
Way more fun. >:3

class Fun < rand < 0.5 ? Array : Hash
 # I am evil!
end

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G

Quote from: Blizzard on June 10, 2009, 05:35:44 am
Way more fun. >:3

class Fun < rand < 0.5 ? Array : Hash
 # I am evil!
end




I really dont get what it does. I've ran my game with that script in it and nothing happens.

Zeriab

Quote from: Blizzard on June 10, 2009, 05:35:44 am
Way more fun. >:3

class Fun < rand < 0.5 ? Array : Hash
  # I am evil!
end




How did you know that was my first version D:
I bet you went through logs and saw how it was before I edited my post >:(
It's more fun, but not as evil if you want to mess with people >:3

G_G

i still dont get the script can someone explain this wierd 2 line code to a noob like me?

Zeriab

Try using this code:

class Fun < rand < 0.5 ? Array : Hash
  # I am evil!
end

p Fun.new


Run it a few times and you'll see ;)

G_G

it prints this
[] or {} I still dont see how this can mess up a game...

Blizzard

It will mess at least two things. One is .each and any submethod that uses .each and another one is simply the indexing. Hash's allowed everything as key (or index) while arrays allow only numbers. .each on Array iterates through every value while Hash iterates through the key and the value. >:3

Use Fun.new instead of [] (or Array.new) and {} (or Hash.new). >:3
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

fugibo

Err, try this for a more obvious error

class Fun < rand < 0.5 ? Array : Hash
end

x = Fun.new
Fun[0] = 2; Fun[1] = 97; Fun[2] = 19023523532
Fun.each do |n| print n end