Decided to make a thread for those interested to post their small tidbits of code that just improve quality of life a bit. Any and all are welcome to post whatever you'd like to share that make daily tasks easier for you.
I'll start by sharing a little piece of code I wrote up quickly for
@Kayeil that just tells you the amount you'd need to withdraw (fee included) at a bank to get your desired amount withdrawn. The default alias is bankfee <desired amount> and it will do the math and use cecho's to tell you how much you'd need to withdraw in Delos and in a city to get the desired amount back. It involves some decimals at times that may leave you 1 gold short and force another withdrawal to reach the desired amount. To fix that I use math.ceil to always make sure you get the amount you wanted. That being said sometimes the number it gives you to withdraw may leave you with 1 extra gold but should never leave you with 1 less. I'll post the code here and share a dropbox link as well.
Pattern: ^bankfee (\d+)$
Code:
<p>wantedAmount = matches[2]</p><p><br></p><p>withdrawAmount = tonumber(wantedAmount/.98)</p>
<p>cityWithdraw = tonumber(wantedAmount/.995)</p>
<p>cecho("\n<green>Delos: <yellow>You need to withdraw "..math.ceil(withdrawAmount).." gold to get "..wantedAmount.." gold.")</p>
<p>cecho("\n<green>City: <yellow>You need to withdraw "..math.ceil(cityWithdraw).." gold to get "..wantedAmount.." gold.")</p>
Dropbox: Bank Fee Calculator
Comments
Edit: Confirmed it doesn't cover Delos. Though it should. May idea it or something to see if we can't get that added.
This one reminds you what the alias is to figure out the ink prices. You can, of course, change it to a different name if something else is easier for you.
Pattern:
^iprice$
Code:
cecho("<cyan>\n ikprice b/go/gr/p/r/y (no slashes)")
This is the actual code that prices the inks at 50% off Rurin's price.
Pattern:
^ikprice (.+)b(.+)go(.+)gr(.+)p(.+)r(.+)y$
Code:
So if I want to sell 50 of each colour, I enter:
ikprice 50 b 50 go 50 gr 50 p 50 r 50 y
I get this output:
Pattern: ^lookup (\d+)$
Code:
--Another very simple one I used is just to open the forums. Because laziness.
Pattern: ^forums$
Code:
--There are a lot of small things you can use these for such as finding a definition, linking to personal things, linking to illustrated map, your music, etc. None of these codes are supposed to be super fancy or something hard to code/do. More or less a way to share and say hey... if you haven't seen this or thought of this you should try it if you think its useful.
Script:
openUserWindow("Chatbox")
--Simple as that. Just opens a new dockable window named Chatbox for you.
Capturing Different types of chat triggers:
--Anything that starts with (Whatever): can just be captured with exactly that with begin of line substring set.
Example:
--For adding tells you may need a few lines. I know the ones I use currently do not pick up Divine speaking to you or if someone uses a different language, but those could be easily added. All of these should be perl regex lines.
Example:
--I have all of this code in one big messy trigger I just add to whenever I join a new clan or whatever. Be as neat as you want to I suppose. The code for the one big messy trigger for me is as follows.
Code:
Its not the prettiest or the neatest but it works and it works well for me. Being able to go back through a conversation is simple and I could never get used to tabbed chat personally. Didn't want to have to click around to see different things. If you decide to try this or it isn't working for you feel free to shoot me a message. I'm pretty sure I've included everything. I figured it was simple enough for someone to implement on their own but if someone wants me to dropbox it with a few basic triggers to get you started I can.Picture in spoiler