Author Topic: Thanks, and an idea  (Read 6093 times)

0 Members and 1 Guest are viewing this topic.

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +11
  • Referrals: 5
    • View Profile
Thanks, and an idea
« on: August 06, 2010, 09:33:03 AM »
0
Thanks for this. It has really helped me to learn proper scripting and catch my errors myself.

One common error I make is I forget the # for sysvariables. (like true and #true, findid and #findid). If a variable is spelled correctly, could SUO detect that the # is not appended?

Same with % and * variables. Those are unrecognized format without. Would it be possible to detect those too?
Code: [Select]
set baldguy #newb , for example, could be detected as not having correct variable format.

Offline Cerveza

  • Hacksimus Maximus
  • Scripthack
  • *
  • Posts: 5857
  • Activity:
    0%
  • Reputation Power: 80
  • Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!Cerveza is awe-inspiring!
  • Gender: Male
  • So... Hows that Hopey-Changey thing working out?
  • Respect: +403
  • Referrals: 11
    • View Profile
Re: Thanks, and an idea
« Reply #1 on: August 06, 2010, 09:44:15 AM »
0
Here ya go...



So how exactly is ScriptUO going to know if your using a session variable (%baldguy) or a namespace variable (!baldguy) or a saved system variable (*baldguy)?

Some thing you just need to do for youself ;)
XXXXXXXXXX________________________________________] 20%
I've forgotten more about this game then most people will ever know.
Thank you for controlling your children. Their manners reflect your love for them.
Give a man a fish and you feed him for a day. Don't teach a man to fish, and you feed yourself. He's a grown man. Fishing's not that hard.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Thanks, and an idea
« Reply #2 on: August 06, 2010, 09:50:24 AM »
0
Well you kinda have to pay attention to the colorization.  You'll notice that if you don't type in a valid system variable (#VAR), then it won't color correctly. Same goes for !vars and %vars.

With that said, ScriptUO can only do so much policing before it kinda has to leave things up to the programmer.

For !vars and %vars, there really isn't anything that could be done.  However, it would be possible to flag unknown #vars with warnings.  That's not a bad suggestion.  Unsure when I'll be doing another release of ScriptUO, but I'll add that idea to the mix.
Please read the ScriptUO site RULES
Come play RIFT with me!

Offline baldielocksTopic starter

  • Sr. Member
  • *
  • Posts: 301
  • Activity:
    0%
  • Reputation Power: 4
  • baldielocks has no influence.
  • Gender: Male
  • Respect: +11
  • Referrals: 5
    • View Profile
Re: Thanks, and an idea
« Reply #3 on: August 06, 2010, 09:53:48 AM »
0
hey, the man said ask! JK. Basically, it can detect if a variable should be there, not which kind. Like you say, gotta do somethings on your own. But I have two 1K plus line scripts I am writing, and man would it help to quickly scan my variables! I currently detect through the variable pane, and check to see that all my newly coded variables show up.

Thanks TM for considering it. I have found a couple scripts other than my own that could have used this as well.

Offline TrailMyx

  • Officially retired from UO
  • Administrator
  • *
  • *
  • Posts: 13301
  • Activity:
    0%
  • Reputation Power: 154
  • TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!TrailMyx is awe-inspiring!
  • Gender: Male
  • Viper!
  • Respect: +1349
  • Referrals: 33
    • View Profile
    • ScriptUO
Re: Thanks, and an idea
« Reply #4 on: August 06, 2010, 09:57:00 AM »
0
We go over to EasyUO every once in a while and pull out the syntax checker results on some of the scripts.  People wonder what kinda of evil magic we are using.  It's kinda humorous.  

It's not perfect, but it sure does help get you 95%.

It's still my opinion where ScriptUO really shines is on larger scripts.
« Last Edit: August 06, 2010, 09:59:27 AM by TrailMyx »
Please read the ScriptUO site RULES
Come play RIFT with me!

Scrripty

  • Guest
Re: Thanks, and an idea
« Reply #5 on: August 06, 2010, 01:26:19 PM »
0
ScriptUO is the *bleep*.  Sorry for the bad word.  But it is. :)

Tags: