Page 1 of 1

any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 1:12 am
by lisa
I used to have a notepad and pen by my keyboard when making WP so that I could then add in all the extra stuff after I had finished.

I've been messing around and I changed the createpath to have another option, an add comment option. So when I want to add things in places of the WP I hit the key and type in what I want. Then when I open the WP file it has the comments for the WP I stated earlier so I can add in the things I wanted to.

Anyone else interested in that? If so I'll send the files to rock5 to check out and he might add it.

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 2:56 am
by rock5
I like the idea although aren't we running a bit low on keypad numbers?

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 3:05 am
by lisa
I used 0, At first I used C but in the end I decided to stay with the keypadnumber theme.

output is like this.

Code: Select all

	<!-- #  3 --><waypoint x="-146" z="-6899" y="42">	</waypoint>
	<!-- #  4 --><waypoint x="-146" z="-6899" y="42">
		 <!-- talk to me -->
	</waypoint>
	<!-- #  6 --><waypoint x="-146" z="-6899" y="42">	</waypoint>
'talk to me' was my user input, only issue would be if somone actually typed --> then it would close the tag early. Was trying to find a way to make it only accept letters and numbers but in the end I decided it would be very rare for someone to accidently type --> so just left it as is.

So for me I type in the code I want at the time and then I can just go in later and delete out the <!-- -->
or if I am in a rush I just type something to remind me what I wanted to do at the time.

I spent a few hours trying to make it close tag before comments and then not have another close tag added but in the end I decided there is no harm in the comment being between the waypoint tags, I even like that idea more now.

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 3:35 am
by rock5
Why put your comment between <!-- and -->? Why not just output,

Code: Select all

	<!-- #  3 --><waypoint x="-146" z="-6899" y="42">	</waypoint>
	<!-- #  4 --><waypoint x="-146" z="-6899" y="42">
		 talk to me
	</waypoint>
	<!-- #  6 --><waypoint x="-146" z="-6899" y="42">	</waypoint>
That way you could enter commands directly while using createpath and not need to go back and edit it.

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 3:47 am
by lisa
I actually assumed the bot would read it and try to use it in some way since you can add code to inside waypoint tags. Also having the <!-- --> makes it stand out more a little from the rest of the code.
I'll have to rethink this as I like the idea of adding the code straight in as I make WP without having to go back later to edit it.

Tested it, without the <!-- --> it returns an error. failed to compile and run Lua code.

so if you didn't type code you would need to add in the tags.
Wouldn't be to hard to type <!-- buy bow --> when not adding code and just doing notes.
I'm thinking I will change it to have <!-- zz zz --> as default. That will make it easy to use replace later if I added in code directly and if I just added notes then it won't get errors.

Code: Select all

   <!-- #  3 --><waypoint x="-146" z="-6899" y="42">   </waypoint>
   <!-- #  4 --><waypoint x="-146" z="-6899" y="42">
       <!-- zz talk to me zz -->
   </waypoint>
   <!-- #  6 --><waypoint x="-146" z="-6899" y="42">   </waypoint>


Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 4:45 am
by rock5
You're forgetting that the 'comment' is being placed between waypoint tags so it's technically lua. To comment in lua you use '--'.

So if you leave out the <!-- and --> you can enter commands directly. If you want to comment it with the intention of editing it later before running it, you can type anything. If you want it to work with the comment in place just just prefix the comment with '--'.

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 5:43 am
by lisa
How would that affect what comes after the -- though? as in technically the </waypoint> will be after the --

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 7:02 am
by rock5
lisa wrote:How would that affect what comes after the -- though? as in technically the </waypoint> will be after the --
Well it puts the </waypoint> on a new line so it shouldn't be a problem.

On another note, I should really add player:target_Object too.

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 7:42 am
by lisa
as in what the mouse is hovering over? I would assume if you meant an actual targeted object, then you could just adapt the target npc to fit.

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 8:18 am
by rock5
lisa wrote:as in what the mouse is hovering over? I would assume if you meant an actual targeted object, then you could just adapt the target npc to fit.
Some targets you can't target by clicking on them so, yes, mouse over is what I meant. No keys left though. Maybe I could use the '+' key?

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 9:14 am
by lisa
I don't see any reason not to use the + key, one of the reasons I decided not to use C key was because by default it is also character info shortcut. So if someone was creating a path and decided to look at their char info for some reason it would trigger the comment command.
i don't think any of the numberpad keys are shortcuts to anything by default.

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 10:03 am
by jduartedj
like rock5 suggested I think It could be an option to add a "custom code" to the WP, this way we could input any function or just a comment using -- before what we write! I'd personally prefer the "NUM+" (NUMPADPLUS?) key because I already use Numpad 0 key for calling a mount while gaming.

EDIT: That last setence didn't made a lot of since cuz i also use Num keys to cast spells.... NUM0 or Num+ doesn't really matter to me really.

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 10:35 am
by rock5
Just tested with my 'target_Object' option. BTW I ended up using the decimal point for targeting objects.

So what I was able to do was,
1. Use '1' to mark waypoints to a mailbox
2. While holding the mouse over the mail box, press the numpad dot to target the mailbox.
3. Press '0' to enter a 'yrest(1000)'.
4. press '0' to enter "UMM_TakeMail()' command.
5. Press '0' to enter another yrest.
6. Use '1' to mark waypoints to another location.
7. Press '0' to enter an 'error("Finished")' command to end the script.

It worked flawlessly. Are you guys as exited by this as I am? :D

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 10:50 am
by rock5
I've added it to rev 560.

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 11:08 am
by lisa
YAY ;)

Re: any interest in a comment option for createpath.lua ??

Posted: Sat Jan 15, 2011 11:43 am
by jduartedj
SUUUUUWWWWWEEEEEEEETTTTTT