SRL Archive - Suggestions

Debugging features.


Wizzup?

2009-11-15 20:52:42

Hoi,

Raymond and I have been adding some nice error handling in Mufasa.


program new;
var x:integer;
begin
findbitmapin(-1,x,x,0,0,100,100);
end.

Compiled succesfully in 8 ms.
Error: Exception: The bitmap[-1] does not exist at line 4


program new;
begin
movemouse(-1,0);
end.

Compiled succesfully in 8 ms.
Error: Exception: SetMousePos: X, Y (-1, 0) is not valid at line 3

We've also nested it deeply in the all Client/Image stuff, so you can't access non existing pixels, etc.

Anyway… you can also give Bitmaps a name, and afaik if you don't free them, the names will be printed at the end of the scripts, with the message that they haven't been freed. Same for files (name = file path).

DTM still needs a bit of a rewrite…

Any other suggestions to add more user friendly error handling? Something we may have overlooked, etc?

Hobbit

2009-11-15 21:08:04

Is this a project i can work on???

SERIOUSLY PLEASE I NEED SOMETHING :(

YoHoJo

2009-11-15 21:11:49

From: Hobbit
Is this a project i can work on???

SERIOUSLY PLEASE I NEED SOMETHING :(


Make a script!

Sir R. M8gic1an

2009-11-15 21:25:47

From: Hobbit
Is this a project i can work on???

SERIOUSLY PLEASE I NEED SOMETHING :(


  1. Open a google page
  2. Get Toilet paper
  3. Lock room
  4. Lights off
  5. Insert headphones
  6. Put Volume to max
  7. Wear headphones
  8. Type 'free porn' into google
  9. Press Search
  10. Click random videos
  11. Profit = win

~RM

Nava2

2009-11-15 22:16:28

From: Rasta Magician
  1. Open a google page
  2. Get Toilet paper
  3. Lock room
  4. Lights off
  5. Insert headphones
  6. Put Volume to max
  7. Wear headphones
  8. Type 'free porn' into google
  9. Press Search
  10. Click random videos
  11. Profit = win

~RM


I've done that many-a-time and have yet to see profit..

Hobbit, research a new CTS formula :)

bullzeye95

2009-11-15 22:40:16

I should be able to add breakpoint support tomorrow, unless this will somehow greatly compromise speed.

From: Nava2
I've done that many-a-time and have yet to see profit..

Easy profit.

Nava2

2009-11-15 23:08:58

From: bullzeye95
I should be able to add breakpoint support tomorrow, unless this will somehow greatly compromise speed.


Easy profit.


Perhaps include a Define if its going to compromise speed.

Good idea!

Markus

2009-11-17 13:40:26

You see the latest post in r.p.pascalscript? Something like being able to change variables in the script on the fly would be really cool :p

mastaraymond

2009-11-17 13:58:10

From: Markus
You see the latest post in r.p.pascalscript? Something like being able to change variables in the script on the fly would be really cool :p

What would be the use? :p

R0b0t1

2009-11-17 14:39:31

Why print them, just have a garbage collector.

It's like, "YOU FUCKED UP AND I COULDA HELPED BUT I DIDN'T SORRY LOL"

mixster

2009-11-17 16:27:51

I would think it auto collects at end anyway, but just a little message to say "erm, yeah you didn't do that. It's not really my job, but I did it for you this time. Maybe next time you're a bit more careful?" - especially if it leads to a mass bitmap creation of a few hundred.

Oh, nude women into google images gives much better results than free porn.

Would also like to see Markus's idea along with a little dialog that lists all currently in use variables, where in the script it is etc as an extra little debugging option rather than the normal play (surely it would annoy people if it popped up always).

Markus

2009-11-17 16:53:28

From: mastaraymond
What would be the use? :p


Like I got RS script and the autocolor fucks up, so I can override the colour stored in the variable. Or in a game to cheat the highscores! The possibilities are endless!

mixster

2009-11-17 17:19:53

I would say more it would be useful for when you accidentally something but it's a large script and restarting it would be annoying. Or the obvious and would allow you to set players to true after fixing (etc) without needing to restart.

Yakman

2009-11-17 20:05:11

Allowing you to view and set variables is one of the most useful tools in any debugger.

mastaraymond

2009-11-18 08:45:22

From: Yakman
Allowing you to view and set variables is one of the most useful tools in any debugger.

Personally never used it and still don't see a practical use for RS scripts, but might be just me..

Markus

2009-11-18 10:50:22

From: mastaraymond
Personally never used it and still don't see a practical use for RS scripts, but might be just me..


Maybe not in RS Scripts, but RL programs it's useful for.
Just do it, you never used it because you never had the ability to. Mufasa is a new era in RuneScape Cheating! New era's need new features noone else thought of before. + it would be perfect to piss in freddy's face: "tons of debug features! makes your scripting life a lot easier" xD

NxTitle

2009-11-18 10:56:02

I don't know about you, then, because there are two very important things I look for in a debugger: breakpoints and being able to view/set variables during those breakpoints.

Wizzup?

2009-11-18 10:59:38

From: NxTitle
I don't know about you, then, because there are two very important things I look for in a debugger: breakpoints and being able to view/set variables during those breakpoints.


Yes, but Pascal Script is so simple one wouldn't really need a real debugger.
Generally exceptions are fine. It's not like someone can create segfaults with pascalscript. :p

NxTitle

2009-11-18 11:06:23

Well when I'm done with it I'm sure I'll be able to get it to segfault somehow :P

Either way though, even if you don't need to worry about segfaults I still think it would be useful, especially if someone is running in debugging mode and they need to quickly figure out what a certain variable is. They should just be able to pause it, then go to a menu and get the value of a variable. Setting variables, I don't think I've ever used such a feature but getting variables is usually quite helpful.

mastaraymond

2009-11-18 13:22:15

Scar has this mode as well btw..

Wizzup?

2009-11-18 14:03:00

From: mastaraymond
Scar has this mode as well btw..


I never knew it allowed me to view values of script variables. Not have I seen it print out custom made exceptions.

What are you referring to, step into and step over + breakpoints?

nielsie95

2009-11-18 14:05:43

Hover your mouse over a variable while the script is paused ;)

Wizzup?

2009-11-18 14:10:27

From: nielsie95
Hover your mouse over a variable while the script is paused ;)


Ok, cool. Never seen that before. Too bad it was never taken to a higher level.

Markus

2009-11-18 14:14:56

Well, there is this "Watches" screen too but no one uses it.

Edit: brilliant idea! http://video.google.com/videoplay?docid=3897010229726822034&q=engedu+debugging#