PDA

View Full Version : Lich & a window...



Deathravin
06-18-2007, 04:03 PM
I'm curious if there is a way to open a text window similar to the bounties or room windows in SF (either in SF or Wizard, I care not), and put data in there that can change. I thought about echoing the data in the story window, but I realized I want to be able to see it at any time.

Maybe do it by spoofing a container window or something....


I'll tell you what it's for in case somebody can think of a better idea...

I was making a lockpicking script (a rather complicated one) and in my information gathering phase I realized I enjoy picking in general and figured out that I don't necessairly want to type "accept" "Disarm strongbox" "Get my black lockpick" "LM PT TW my strongbox" every time, but I do want to be actively participating in the box opening process... So I have somewhat scrapped my lich picking script - based largely off my 'sitnpick' and 'picknstuff' scripts for wizard and SF... but I will be making a Locksmith Companion script.

It will record each box, who gave it to me, how hard it was, which lockpick I used etc, and put it into an access database-type system... It records everything about the picking, disarming, mastery processes, and displays it. I was thinking doing a simple echo such as:

SoandSo offers you a strongbox.
*** SoandSo record ***
*** 54 total boxes
*** TRAPS: range between -40 and -150: Median -120
*** LOCKS: range between -150 and -250, median -220
*** TIPS: range between 232 and 1523 per box, median 1000 per box
*** Scarab policy: Has declined the scarab 98% of the time


You remove a black vaalin lockpick from your myklian scale case.
*** Black Vaalin Lockpick record ***
*** Opened 250 total boxes
*** LOCKS: range between -350 and -550
*** Current skill with pick -
***** No Lore: Max: -752 - 50 roll = -680
***** Lore: Max: -973 - 50 roll = -930



etc... But I would like to put that data in another window that gets updated periodically...

--Locksmithing--
:: Current Client data :: :: Current Box data :: :: Current Lockpick Data ::
SoandSo Heavy monwir strongbox black vaalin lockpick
TRAPS: -150 to -250 TRAP: -210 fire vial
LOCKS: -300 to -450 LOCK: unknown LOCK: -752 max


etc... and it updates constantly, if I measure the lock it will update the current box data, if I get a trap it will highlight the background of the trap data... it recommends which lockpick to use, with or without lore, it will give you your current LM task and recommend picks based if you can probably get a rep off of it etc...


It might get old, it might be dumb, but I like the idea of a locksmith companion window. You can make decisions, it can remember things for you, and you still get to pick but with the most data possible at your fingertips.



At any rate, anybody know if there's a way (in lich or whatever) to make either an in-game window or a seperate window with all that data in it? I could probably do it in HTML (update a .html file and have it reload itself once every few moments and when forced to update by the code of the script) if I tried hard enough, but I'd rather not do it that way if I don't have to.

Celephais
06-18-2007, 04:26 PM
Okay so someone else is going to have to pitch in for the Lich specifics, but this is what you want to send to the SF XML datastream:


<openDialog type='dynamic' id='pickCompanion' title='Locksmith Companion' location='right' height='105' width='450' resident='true'>
<dialogData id='pickCompanion'>
<label id='Client' value='SoAndSo' top='0' left='0' align='n' width='150' height='15'/>
<progressBar id='tips' value='50' text='50th percential tipper' top='15' left='3' align='n' width='150' height='15'/>
<label id='ClientTrap' value='Traps: -150 to -250' top='30' left='0' align='n' width='150' height='15'/>
<label id='ClientLock' value='Locks: -300 to -450' top='45' left='0' align='n' width='150' height='15'/>
<label id='Box' value='heavy monwir strongbox' top='0' left='150' align='n' width='150' height='15'/>
<link id='BoxTrap' value='Trap: -210 Fire Vial' cmd='disarm my strongbox' top='30' align='n' left='150' echo='Disarming...' width='150'/>
<link id='BoxLock' value='Lock: Unknown' cmd='pick my strongbox with my lockpick' top='45' align='n' left='150' echo='Picking...' width='150'/>
<link id='Lockpick' value='black vaalin lockpick' cmd='get my vaalin lockpick' top='0' align='n' left='300' echo='Retrieving Lockpick...' width='150'/>
</dialogData>
</openDialog>

You'll have to play with the lefts/top etc, you might have to throw in a few anchors if you want it to play nice with resizing, I can help you out more with that once you get it looking nice. This will essentially create a window akin to the exp window for you. This should be very self explanatory... I threw in some links (clicking on them will send the cmd, and show the client the echo), labels (obvious), and progressbar (you could visually display things like how good a tipper the person is relative to your other clients, like the exp progress bar).

after you send the open dialog command once you can update any value at any time by just addressing it's "id" and updating it... so if now your script sees the lock is a -412 lock you would send:


<dialogData id='pickCompanion'>
<link id='BoxLock' value='Lock: -412' cmd='pick my strongbox with my lockpick' top='45' align='n' left='150' echo='Picking...' width='150'/>
</dialogData>

Very cool idea, good luck with it.

Deathravin
06-18-2007, 04:56 PM
Rock on!

I bet I could look at the XPWatch script to see how to send it via lich - and a good idea what to send. I forgot that there was another script that basically does what I want this to do...

I would probably prefer it in Stormfront, because I've become fairly used to that on my rogue anyway. - When I don't have an auto-updating room window I get paranoid.

Celephais
06-18-2007, 07:13 PM
After a little tweaking... http://www.deadlylight.com/images/lsmith.jpg

Is produced by sending this stream:

<openDialog type='dynamic' id='pickCompanion' title='Locksmith Companion' location='right' height='105' width='450' resident='true'><dialogData id='pickCompanion'><label id='Client' value='SoAndSo' top='0' left='-160' align='n' width='150' height='15'/><progressBar id='tips' value='50' text='50th percential tipper' top='15' left='-160' align='n' width='150' height='15'/><label id='ClientTrap' value='Traps: -150 to -250' top='30' left='-160' align='n' width='150' height='15'/><label id='ClientLock' value='Locks: -300 to -450' top='45' left='-160' align='n' width='150' height='15'/><label id='Box' value='heavy monwir strongbox' top='0' left='0' align='n' width='170' height='15'/><link id='BoxTrap' value='Trap: -210 Fire Vial' cmd='disarm my strongbox' top='30' align='n' left='0' echo='Disarming...' width='150'/><link id='BoxLock' value='Lock: Unknown' cmd='pick my strongbox with my lockpick' top='45' align='n' left='0' echo='Picking...' width='150'/><link id='Lockpick' value='black vaalin lockpick' cmd='get my vaalin lockpick' top='0' align='n' left='160' echo='Retrieving Lockpick...' width='150'/></dialogData></openDialog>

You'll note I clicked on the links just to show them working.

Deathravin
06-18-2007, 08:46 PM
That's perfect! I was brainstorming on the way home today, and thought of another few things, but the fact you can have a % bar like that answers all the questions I was going to ask when I got home.

Okie, going to start working on it now. Need a few things until I get to the level of displaying the data stage... coolio

Deathravin
06-20-2007, 12:10 AM
Is it just me, or is it harder than hell to remember to NOT put a captial letter in front of your variables?

Don't get me wrong it completely makes sense having Caps be Constant and lowercase be variable... but years and years and years of coding, a well-trained habit of capitalizing Variables and keeping things neat (at least neat to me) is just working against me here... ... just a small rant (please don't think i want it changed or anything).

Just means all my variables will be:

lcClient
lcCurBoxType

TheEschaton
06-20-2007, 12:16 AM
I've always been initial cap lowercase, subsequent caps uppercase.

-TheE-

Deathravin
06-20-2007, 11:39 AM
I've been looking through different coding things I've done and every single one has the exact same format. I have a tendency to not put in comments, but other than that it looks pretty good. That initial lower-case is going to keep biting me in the ass, I can feel it...

It's just that I need to get used to something new, which for me is pretty damn tough for me. ><

Shaelun
06-20-2007, 04:12 PM
You can use constants instead of variables. You can actually alter the value of constants in Ruby. I really don't recommend it, and they're going to be global instead of local, but it won't melt your computer or anything. If the irritating "changing defined constant," warning is irritating you, set the global $VERBOSE variable to equal nil ($VERBOSE = nil).

Just FYI, it's standard in every language I've ever worked in to keep variables lower case. Ruby, C, C++, Java, etc.. They all do it that way. Variables are lower case, constants or macros are all caps, classes usually start with a capital, so on and so on. Convention is good to follow, but you aren't gonna go to jail if you break it or anything, ya know.

Deathravin
06-20-2007, 09:21 PM
REALLY? I've worked in VB, C, C++, Lua, Java. Most of them were only constants if you difined them as a constant (something like "Const blablabla = 2")


I dunno... Maybe I'm just not remembering properly, it's been 10+ years since I played with C++. VB i know it doesn't matter... I use that constantly (mainly for dumb things like VBScripting for Excel and Word than actual programming).

Anebriated
06-21-2007, 01:15 AM
wow, very cool idea

Shaelun
06-21-2007, 07:55 PM
REALLY? I've worked in VB, C, C++, Lua, Java. Most of them were only constants if you difined them as a constant (something like "Const blablabla = 2")


I dunno... Maybe I'm just not remembering properly, it's been 10+ years since I played with C++. VB i know it doesn't matter... I use that constantly (mainly for dumb things like VBScripting for Excel and Word than actual programming).

No, you're not really remembering improperly. It's just convention, not a grammatical rule of the languages. It makes understanding code a lot easier when you can rely on certain nearly-universal things like convention. But it really is almost universal. I can't honestly think of a single program's source I've ever looked at that violated the basic naming conventions... but again, you're not gonna go to jail. Ruby just happens to take the capital letter as a "hint" that means the identifier is a constant.

What it really boils down to is that purely interpreted, dynamic languages can get pretty slow: one of the things I like about Ruby is that it's just as fast as other scripting languages (except Lua... but Lua is a lot less complex), while being as dynamic as it gets and 100% object-oriented. Doing things like assuming capitalized identifiers are constants instead of local variables helps it be speedy.

Deathravin
06-22-2007, 11:46 AM
Well I'll remember that about variable naming conventions. I wish I had gone to school to be a programmer rather than whatever it is I am doing now, I think I would have had fun...

I just had a Computer Science teacher that turned me off of programming in highschool - All he did all day was stand up at the front of the class and babble on about convention and style and best practices bla bla bla bla bla... All I did all day was making programs to do my math homework for me... and rerollers for Gemstone (and mock rerollers to find the probability of that mysterious 660+ roll)... and make pong... and that 'mystify your mind' screensaver (pretty much pong with 8 balls & lines instead of circles)... And skipping ahead in the book to the midterm and final programs - cranking those out real quick...

As you can imagine he wasn't too thrilled about me dismissing his class in such 'frivlous' ways... Never had as much fun getting an F in my life. But he would always bash me and be a general dick toward me... Mr. Lombardo please don't critize my lack of comments... Please Mr Lombardo, stop... I am NOT a waste of a chair... my code ISN'T bloated and overly complex!!...

><

Shaelun
06-22-2007, 06:25 PM
Hahahahah... My mother has a master's degree in computer science, and she started teaching me to program in QBasic when I was 10. I took Assembly and C programming in college 6 years ago (yes, I'm still an undergrad today... I partied too much back then and only recently started again, what can I say), but that isn't how I learned to program. And quite frankly I don't think I would've been able to learn that way. Everything I know I learned out of school working on "for fun" projects.

I'm continually amazed at just how boring, bland, and useless academia makes things sound. Just have fun playing with code, and you may well learn more than you would've learned in school.

Anebriated
10-01-2007, 03:35 PM
Did this ever go anywhere? Id love a copy if so.

Deathravin
10-01-2007, 04:09 PM
><

I played around with it, then real life intruded. I have a couple weeks off at the end of this month, I *MIGHT* take another look.

Anebriated
10-01-2007, 04:24 PM
SLACKER! jk, im going to play around with it but my overall knowledge of lich isnt that good yet.

Danical
10-01-2007, 05:48 PM
Such an awesome idea.

Good luck!

I'd help but my lich skills are next to nil.