Chaos Project

General => Entertainment => Topic started by: G_G on June 07, 2009, 06:54:11 pm

Title: [XP] RMXP Errors
Post by: G_G on June 07, 2009, 06:54:11 pm
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




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




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.
Title: Re: [XP] RMXP Errors
Post by: Sally on June 07, 2009, 08:12:02 pm
sexy.
Title: Re: [XP] RMXP Errors
Post by: fugibo 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
Title: Re: [XP] RMXP Errors
Post by: Blizzard on June 08, 2009, 03:56:48 am
Who cares about details here.

WcW.disable_shutup_recovery
WcW.shutup

Title: Re: [XP] RMXP Errors
Post by: Diokatsu on June 08, 2009, 11:53:10 am
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
Title: Re: [XP] RMXP Errors
Post by: fugibo on June 08, 2009, 12:19:38 pm
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]
Title: Re: [XP] RMXP Errors
Post by: 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:
Title: Re: [XP] RMXP Errors
Post by: fugibo on June 09, 2009, 05:36:41 pm
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...?
Title: Re: [XP] RMXP Errors
Post by: Zeriab on June 10, 2009, 04:46:42 am
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
Title: Re: [XP] RMXP Errors
Post by: Blizzard on June 10, 2009, 05:35:44 am
Way more fun. >:3

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

Title: Re: [XP] RMXP Errors
Post by: G_G on June 10, 2009, 05:36:41 am
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.
Title: Re: [XP] RMXP Errors
Post by: Zeriab on June 10, 2009, 05:38:30 am
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
Title: Re: [XP] RMXP Errors
Post by: G_G on June 10, 2009, 05:39:38 am
i still dont get the script can someone explain this wierd 2 line code to a noob like me?
Title: Re: [XP] RMXP Errors
Post by: Zeriab on June 10, 2009, 05:40:46 am
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 ;)
Title: Re: [XP] RMXP Errors
Post by: G_G on June 10, 2009, 05:42:30 am
it prints this
[] or {} I still dont see how this can mess up a game...
Title: Re: [XP] RMXP Errors
Post by: Blizzard on June 10, 2009, 05:43:58 am
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
Title: Re: [XP] RMXP Errors
Post by: fugibo on June 10, 2009, 07:59:17 am
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