Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion Goto page Previous  1, 2, 3  Next
Xerakon Posted: Mon Jul 09, 2012 10:54 pm
GUI
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Sat Jul 28, 2012 8:32 pm   
 
Ah, okay. I got it.

Now how do I bring up each variable? I'd like to keep the account linked to the amount, but each needs to be a variable. I'm planning on turning the amounts into gauges, as you can only have a maximum amount in each account, with the account number as a label. But it will need to be automatically populated for each character.

Thanks!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sat Jul 28, 2012 9:56 pm   
 
with the @var.%key syntax
#PRINT @bank.account3225
will return however much as in that account when last you checked.
_________________
Discord: Shalimarwildcat
Reply with quote
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Sat Jul 28, 2012 10:07 pm   
 
Oh, awesome, thanks!

Also, I sent my UI to someone else to test out, and she said that when she imported the XML, all of the buttons (which were configured for toolbar 4, right side of screen), suddenly appeared on her top toolbar, which is apparently numbered as toolbar 4 for her. I didn't know that the toolbars aren't standardly numbered. Is there a way to change this?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sun Jul 29, 2012 11:55 am   
 
in preferances
under user interface
buttons tab
you can define where the toolbars go.
_________________
Discord: Shalimarwildcat
Reply with quote
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Sun Jul 29, 2012 1:32 pm   
 
Ah, good. Much easier to work with. =)

Okay, so, my next question, and I've tried several ways to do this, but basically, I'm trying to set up an IF command.

Code:

#IF (@IS_PILOTING = 1) {#T+ UI/BottomBar/ShipStatus} {#T- UI/BottomBar/ShipStatus}


The issue is that the MUD updates the variable via MSDP, so I can't find what to attach it to. It doesn't run off of any specific trigger, which is why I don't have one to post it to.

I was thinking it should be posted to an event? But I'm not sure which one.
Reply with quote
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Sun Jul 29, 2012 8:50 pm   
 
Nevermind. I figured this one out by using the @variable = 0 as a trigger! =)

Also looking now at this:

Code:

%format("&d:&02d", (@CDTime/60), %mod(@CDTime,60))


This shows 120:0, but i'd like it instead to include hours so it would show 2:0:0 and count down from there. can you help me with that?

Thanks!
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sun Jul 29, 2012 11:51 pm   
 
Assuming @CDTime is a number in seconds, the number of hours will be (@CDTime / 3600), the number of minutes will be %mod(@CDTime / 60, 60) and the number of seconds will be %mod(@CDTime, 60).
Reply with quote
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Sat Aug 04, 2012 11:39 pm   
 
shalimar wrote:
with the @var.%key syntax
#PRINT @bank.account3225
will return however much as in that account when last you checked.


Okay, I've got this. Now, is there any way to display the account number seperately as well? Having issues finding the .key for it. Thanks!
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sat Aug 04, 2012 11:44 pm   
 
%dbkeys(@bank)
will be a stringlist of the keys, or you can use
#SHOWDB @bank
_________________
Discord: Shalimarwildcat
Reply with quote
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Sun Aug 05, 2012 11:36 am   
 
Hrm, but the account numbers can't be pulled up separately?
Reply with quote
shalimar
GURU


Joined: 04 Aug 2002
Posts: 4662
Location: Pensacola, FL, USA

PostPosted: Sun Aug 05, 2012 12:51 pm   
 
Well they can, but why would you need to?
What are you trying to do?
_________________
Discord: Shalimarwildcat
Reply with quote
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Sun Aug 05, 2012 8:01 pm   
 
I'm setting up a status window that pulls up account numbers and their respective amounts. It will need to change for each different character I play, as well as whoever else wants to download it. Coding looks like:

Code:

$line4 = %format("<color red>Account &s:</color> <color lightgrey>&s</color>     <color red>Account &s:</color> <color lightgrey>&s</color>     <color red>Account &s:</color> <color lightgrey>&s</color>     <color red>Account &s:</color> <color lightgrey>&s</color>     <color red>Account &s:</color> <color lightgrey>&s</color>", , @bank.1, , @bank.2, , @bank.3, , @bank.4, , @bank.5)


So in the end it should look like:

Code:

Account xxxxx: 854250     Account xxxxx: 1005000     Account xxxxx: 2010000     Account xxxxx: 1005000     Account xxxxx: 1005000
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Sun Aug 05, 2012 8:35 pm   
 
%expanddb would probably be the easiest way to do that.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Sun Aug 05, 2012 11:42 pm   
 
Try this:
Code:
$line4 = %concat("<color red> Account ", %expanddb(@bank, "</color>     <color red>", ":</color> <color lightgrey>"), "</color>")
Reply with quote
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Mon Aug 06, 2012 2:14 pm   
 
Ah, works like a charm. TY. =)

Also looking to add a feature that allows me to have a running counter of the time I've spent on each character. I had started

Code:

<alias name="starttime" id="1264">
  <value>#WA 1000
CharacterTime = @CharacterTime + 1
starttime</value>
</alias>


With the variable to capture it into, but it seems to malfunction quite abit for some reason. Not sure if there's a more efficient way to do this?

Thanks!
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Aug 06, 2012 3:17 pm   
 
You might want to check out the predefined variable %ctime, which is a running count of the of seconds you have been connected on this session. Make an onDisconnect event which adds %ctime to your @CharacterTime.

[edit]As a side-note, I would be careful of using a repeating alarm of X seconds for this. An alarm like this will guarantee that the variable will not be incremented in _less_ than X seconds, but it may actually take a bit longer than X seconds, because it takes time for Cmud to execute each step in a script, and if there are lots of threads going at once, it has to cycle between all of the threads, doing a few steps at a time. So a repeating alarm for X seconds will, over time, drift from what you intended. You would be better off using an alarm set to go off at specific times, such as -*10, which will fire when the MOD of the connect time is 10.
Reply with quote
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Mon Aug 06, 2012 3:37 pm   
 
Ah, okay great! And for displaying it, I'd like to do DD:HH:MM:SS. Is this right?

Code:

%format("&d:&02d:&02d", (@CharacterTime / 86400), %mod(@CharacterTime / 3600), %mod(@CharacterTime / 60, 60), %mod(@CharacterTime, 60))
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Aug 06, 2012 6:39 pm   
 
You have it almost right:
Code:

%format("&d:&02:&02d:&02d", (@CharacterTime / 86400), %mod((@CharacterTime / 3600), 24), %mod((@CharacterTime / 60), 60), %mod(@CharacterTime, 60))


If you use my suggestion of adding %ctime to @CharacterTime every time you Disconnect, then you may want to replace @CharacterTime in this formula with (@CharacterTime + %ctime) so that it includes the connect time for the current session. Or even replace it with a function you create, @ctime(), which returns the sum of @CharacterTime and %ctime.
Reply with quote
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Mon Aug 06, 2012 7:42 pm   
 
The code posted returns nothing, unfortunately. Tried keeping it simple, and adding in different additions with the ctimes.
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Mon Aug 06, 2012 8:29 pm   
 
Exactly which code returns nothing? The %format certainly should return _something_, even if it is only a set of colons.
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Mon Aug 06, 2012 8:57 pm   
 
You missed a d for the second digit, the format string should be "&d:&02d:&02d:&02d".
Reply with quote
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Thu Aug 09, 2012 5:35 pm   
 
I'm trying to set up a script that pulls up a class and such, however, the MSDP variable is set up as IS_PILOT, and when I set up:

Code:

<trigger priority="10900" id="1090">
  <pattern>@IS_PILOTING=0</pattern>
  <value>#T- ShipStatus</value>
</trigger>


It does not recognize the entire variable, and seems to not recognize the variable due to the underscore. is there a way around this?
Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Thu Aug 09, 2012 6:35 pm   
 
I don't think so. As I recall, Cmud variable names cannot contain underscores. Can you get that into a Cmud variable with a different name?
Reply with quote
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Thu Aug 09, 2012 6:40 pm   
 
Unfortunately, no. It's a MSDP variable, set by the MUD. I'll hafta see if they can change it.
Reply with quote
Xerakon
Apprentice


Joined: 10 May 2011
Posts: 111

PostPosted: Sun Aug 12, 2012 3:56 pm   
 
Code:

config
[ Keyword     ] Option
[-flee        ] You fight back if you get attacked.
[-norank      ] You display your rank on clantalk.
[-norecall    ] You try to recall if fighting link-dead.
[+AUTODRAW    ] You automatically draw your weapons in combat.
[+AUTOEXIT    ] You automatically see exits.
[+AUTOLOOT    ] You automatically loot corpses.
[-commprompt  ] You see a prompt only when you enter commands.
[-screenreader] You are not in screenreader mode.
[-autosac     ] You don't automatically sacrifice corpses.
[+AUTOCRED    ] You automatically split credits from kills in groups.
[-gag         ] You see full battle text.
[-pager       ] Long output scrolls to the end.
[+BLANK       ] You have a blank line before your prompt.
[-brief       ] You see long descriptions.
[+COMBINE     ] You see object lists in combined format.
[-nointro     ] You see the ascii intro screen on login.
[+PROMPT      ] You have a prompt.
[-telnetga    ] You don't receive a telnet GA sequence.
[+ANSI        ] You receive ANSI color sequences.
[-sound       ] You don't have MSP support.
[-censor      ] Profanity filtering is off.
[-compact     ] Compact score is off.
[-nofight     ] You will attack and fight normally in combat.
[-shovedrag   ] You'd rather not be shoved or dragged around.
[-clone       ] You cannot be cloned.
[-autoafk     ] You do not automatically go AFK.
[-noprox      ] You see the normal proximity messages.


This is a basic config menu for the game I play. I was wondering if I can do something like this for "plugins" i include in my GUI, basically turning off classes as the user selects them.

I tried using aliases with something like

Code:

<alias name="xconfig testclass" id="1721">
  <value>#IF (%1 = on) {#T+ testClass}
#IF (%1 = off) {#T- testClass}</value>
</alias>


But the MUD just returns "What?" like an unrecognized input.

Any ideas on this? Thanks!
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net