ok, it does 'work' but I noticed that you didn't carefully check my suggestion using pause(). As it turns out your tool is still skipping certain macro and don't add them to the index. Again this is due to the use of (). Removing those fixes that.
Next issue I run into is that the order is incorrect. I've ordered the main topics as 1,2,3,4 etc. and subtopics first one appearing under 4, which I give order number 4a, 4b, etc, but this topic appears under 3!!. I''l finish the work and then share the lib. Edit here it is:
What you'll see is that the 'special pads' sub-section ends up one topic higher (reported mishaps); dito for events and utilities.
I've also moved it now to its own library: that works great!!
edit: hmm I also now notice that out of nowhere there all of a sudden a lot of lib:notebooks. Apparently everytime I click 'manual' it creates a new lib... which I can't repeat anymore...must have been a fluke
Finally another thingie, it takes too long to load. You can remedy this my storing the end (rendered) result in a token property and call that in the form. And ONLY render when stuff has changed and I would suggest to just have a macro for that: '(re)render index'.
edit: apparently not 'finally' as there's more... I've switched theme to Github (options-> preference -> github) and I got a nice 'loading...' screen...and thats it. Nothing further happens except for an error in the chat:
Can not find map "Grasslands" in function "setCurrentMap".
I've also had a look at your calculator code, which was quite unreadable, I've done the indentation, now Im gonna have a look at the actual code:
Code: Select all
[h:formula=getStrProp(macro.args,"formula")]
[h:output=getStrProp(macro.args,"output")]
[h:entry=getStrProp(macro.args,"entry")]
[h:lastentry=getStrProp(macro.args,"lastentry")]
[h:memory=getStrProp(macro.args,"memory")]
[h:edit=getStrProp(macro.args,"edit")]
[h,if(entry==lastentry),code:{
[h:repeat=string(if(entry=="+"||entry=="-"||entry=="*"||entry=="/","",entry))]
[h:formula=formula+string(repeat)]
};{
[h:formula=formula+string(entry)]
}]
[h:numbercolor="#ddd8d0"]
[h:dicecolor="#d0cac3"]
[h:delcolor="#ec2626"]
[h:signalcolor="#FFBD77"]
[h:equalcolor="#FFAD56"]
[h,if(output==1),code:{
[h:memory=eval(string(if(formula=="",0,formula)))]
};{}]
[h:share=memory]
[h,if(edit==1):res=input("formula|"+formula+"||text|span=true width=30");res=1]
[h:abort(res)]
[dialog("Calculator","width=251; height=402; temporary=0; input=1; noframe=0"): {
<table width=226 border=0 align=center valign=middle>
<tr bgcolor=#e3dcd1>
<td width=25%>
<font color=#4C4C4C size=2 style="text-decoration:none">
[r:macroLink("edit","calculator@This","","edit=1;formula="+formula+";memory="+memory)]
<td colspan=3 height=35 width=75% align=right>
<font size=[r:if(length(formula)<19,4,if(length(formula)<22,3,if(length(formula)<26,2,1)))]>
[r:replace(replace(formula,"\\*","x"),"/","÷")]
</td>
</tr><tr>
<td>
<font color=#4C4C4C size=2 style="text-decoration:none">
[r:macroLink("share","calculator@This","all","share="+share+";formula="+formula+";memory="+memory)]
</td>
</tr>
<td colspan=3 height=55 align=right>
<font size=[r:if(length(memory)<8,7,if(length(memory)<12,6,if(length(memory)<15,5,4)))]>
[r:if(length(memory)<15,"","<b>")]
[r:memory]
</td>
</tr><tr>
<td height=35 align=center bgcolor=[r:dicecolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" d% ","calculator@This","","formula="+formula+";entry=d100;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:dicecolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" dx ","calculator@This","","formula="+formula+";entry=d;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:delcolor]>
<font color=white size=4 style="text-decoration:none"><b>
[h:delformula=substring(formula,0,if(length(formula)==0,0,length(formula)-1))]
[r:macroLink(" del ","calculator@This","","formula="+delformula+";memory="+memory)]
</td><td align=center bgcolor=[r:delcolor]>
<font color=white size=4 style="text-decoration:none"><b>
[r:macroLink(" AC ","calculator@This","","")]
</td>
</tr><tr>
<td align=center height=35 bgcolor=[r:dicecolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" d4 ","calculator@This","","formula="+formula+";entry=d4;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:dicecolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" d6 ","calculator@This","","formula="+formula+";entry=d6;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:dicecolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" d8 ","calculator@This","","formula="+formula+";entry=d8;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:signalcolor]>
<font color=white size=5 style="text-decoration:none">
[r:macroLink(" ÷ ","calculator@This","","formula="+formula+";entry=/;lastentry="+entry+";memory="+memory)]
</td>
</tr><tr>
<td align=center height=35 bgcolor=[r:dicecolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" d10 ","calculator@This","","formula="+formula+";entry=d10;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:dicecolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" d12 ","calculator@This","","formula="+formula+";entry=d12;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:dicecolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" d20 ","calculator@This","","formula="+formula+";entry=d20;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:signalcolor]><b>
<font color=white size=5 style="text-decoration:none">
[r:macroLink(" × ","calculator@This","","formula="+formula+";entry=*;lastentry="+entry+";memory="+memory)]
</td>
</tr><tr>
<td align=center height=35 bgcolor=[r:numbercolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" 7 ","calculator@This","","formula="+formula+";entry=7;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:numbercolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" 8 ","calculator@This","","formula="+formula+";entry=8;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:numbercolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" 9 ","calculator@This","","formula="+formula+";entry=9;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:signalcolor]>
<font color=white size=5 style="text-decoration:none"><b>
[r:macroLink(" - ","calculator@This","","formula="+formula+";entry=-;lastentry="+entry+";memory="+memory)]
</td>
</tr><tr>
<td align=center height=35 bgcolor=[r:numbercolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" 4 ","calculator@This","","formula="+formula+";entry=4;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:numbercolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" 5 ","calculator@This","","formula="+formula+";entry=5;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:numbercolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" 6 ","calculator@This","","formula="+formula+";entry=6;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:signalcolor]>
<font color=white size=5 style="text-decoration:none">
[r:macroLink(" + ","calculator@This","","formula="+formula+";entry=+;lastentry="+entry+";memory="+memory)]
</td>
</tr><tr>
<td align=center height=35 bgcolor=[r:numbercolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" 1 ","calculator@This","","formula="+formula+";entry=1;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:numbercolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" 2 ","calculator@This","","formula="+formula+";entry=2;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:numbercolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" 3 ","calculator@This","","formula="+formula+";entry=3;lastentry="+entry+";memory="+memory)]
</td><td align=center rowspan=2 bgcolor=[r:equalcolor]>
<font color=white size=3 style="text-decoration:none">
[r:macroLink(" <br> <font size=6>=</font> <br> ","calculator@This","","formula="+formula+";output=1;lastentry="+entry+";memory="+memory)]
</tr><tr>
<td align=center height=35 bgcolor=[r:numbercolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" 0 ","calculator@This","","formula="+formula+";entry=0;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:dicecolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" ( ","calculator@This","","formula="+formula+";entry=(;lastentry="+entry+";memory="+memory)]
</td><td align=center bgcolor=[r:dicecolor]>
<font color=black size=4 style="text-decoration:none"><b>
[r:macroLink(" ) ","calculator@This","","formula="+formula+";entry=);lastentry="+entry+";memory="+memory)]
</td>
</tr>
</table>
}]
[r,if(formula==""),code:{};{
<table width="170px" style="border:1px solid black;">
<tr>
<td bgcolor=#4C4C4C valign=middle height=20>
<font color=white><b>
Calculator
</td>
</tr><tr>
<td></td>
</tr>
<table width=100% bgcolor=#ece9d8>
<tr>
<td align=right valign=middle bgcolor=#e3dcd1 height=25>
[r:replace(replace(formula,"\\*","x"),"/","÷")]
</td>
</tr><tr>
<td align=right height=35>
<font size=6>
[r:share]
</td>
</tr>
</table>
</table>
}]
update (in progress):
Code: Select all
[h:formula = getStrProp(macro.args,"formula")]
[h:output = getStrProp(macro.args,"output")]
[h:entry = getStrProp(macro.args,"entry")]
[h:lastentry = getStrProp(macro.args,"lastentry")]
[h:memory = getStrProp(macro.args,"memory")]
[h:edit = getStrProp(macro.args,"edit")]
[h,if(entry==lastentry),code:{
[h:repeat=string(if(entry=="+"||entry=="-"||entry=="*"||entry=="/","",entry))]
[h:formula = formula+string(repeat)]
};{
[h:formula = formula+string(entry)]
}]
[h:numbercolor = "#ddd8d0"]
[h:dicecolor = "#d0cac3"]
[h:delcolor = "#ec2626"]
[h:signalcolor = "#FFBD77"]
[h:equalcolor = "#FFAD56"]
[h:font = "<font color=black size=4 style='text-decoration:none'><b>"]
[h:button = "
<td height=35 align=center bgcolor=%s>
<font color=%s size=4 style='text-decoration:none'><b>
<a href='macro://calculator@lib:test//Impersonated?formula=%{formula}&entry=%s&lastentry=%{entry}&memory=%{memory}'> %s </a>
</td>
"]
[h,if(output==1):memory=eval(string(if(formula=="",0,formula)))]
[h:share=memory]
[h,if(edit==1): abort(input("formula|"+formula+"||text|span=true width=30"))]
[dialog("Calculator","width=251; height=402; temporary=0; input=1; noframe=0"): {
<table width=226 border=0 align=center valign=middle>
<tr bgcolor=#e3dcd1>
<td width=25%>
<font color=#4C4C4C size=2 style="text-decoration:none">
[r:macroLink("edit","calculator@This","","edit=1;formula="+formula+";memory="+memory)]
<td colspan=3 height=35 width=75% align=right>
<font size=[r:if(length(formula)<19,4,if(length(formula)<22,3,if(length(formula)<26,2,1)))]>
[r:replace(replace(formula,"\\*","x"),"/","÷")]
</td>
</tr><tr>
<td>
<font color=#4C4C4C size=2 style="text-decoration:none">
[r:macroLink("share","calculator@This","all","share="+share+";formula="+formula+";memory="+memory)]
</td>
</tr>
<td colspan=3 height=55 align=right>
<font size=[r:if(length(memory)<8,7,if(length(memory)<12,6,if(length(memory)<15,5,4)))]>
[r:if(length(memory)<15,"","<b>")]
[r:memory]
</td>
</tr><tr>
[r:strformat(button, dicecolor, "black", "d100", "d%")]
[r:strformat(button, dicecolor, "black", "d", "dx")]
<td align=center bgcolor=[r:delcolor]>
<font color=white size=4 style="text-decoration:none"><b>
[h:delformula=substring(formula,0,if(length(formula)==0,0,length(formula)-1))]
[r:macroLink(" del ","calculator@This","","formula="+delformula+";memory="+memory)]
</td><td align=center bgcolor=[r:delcolor]>
<font color=white size=4 style="text-decoration:none"><b>
[r:macroLink(" AC ","calculator@This","","")]
</td>
</tr><tr>
[r:strformat(button, dicecolor, "black", "d4", "d4")]
[r:strformat(button, dicecolor, "black", "d6", "d6")]
[r:strformat(button, dicecolor, "black", "d8", "d8")]
[r:strformat(button, signalcolor, "white", "/", "÷")]
</tr><tr>
[r:strformat(button, dicecolor, "black", "d10", "d10")]
[r:strformat(button, dicecolor, "black", "d12", "d12")]
[r:strformat(button, dicecolor, "black", "d20", "d20")]
[r:strformat(button, signalcolor, "white", "*", "×")]
</tr><tr>
[r:strformat(button, numbercolor, "black", "7", "7")]
[r:strformat(button, numbercolor, "black", "8", "8")]
[r:strformat(button, numbercolor, "black", "9", "9")]
[r:strformat(button, signalcolor, "white", "-", "-")]
</tr><tr>
[r:strformat(button, numbercolor, "black", "4", "4")]
[r:strformat(button, numbercolor, "black", "5", "5")]
[r:strformat(button, numbercolor, "black", "6", "6")]
[r:strformat(button, signalcolor, "white", "+", "+")]
</tr><tr>
[r:strformat(button, numbercolor, "black", "1", "1")]
[r:strformat(button, numbercolor, "black", "2", "2")]
[r:strformat(button, numbercolor, "black", "3", "3")]
</td><td align=center rowspan=2 bgcolor=[r:equalcolor]>
<font color=white size=3 style="text-decoration:none">
[r:macroLink(" <br> <font size=6>=</font> <br> ","calculator@This","","formula="+formula+";output=1;lastentry="+entry+";memory="+memory)]
</tr><tr>
[r:strformat(button, numbercolor, "black", "0", "0")]
[r:strformat(button, dicecolor, "black", "(", "(")]
[r:strformat(button, dicecolor, "black", ")", ")")]
</tr>
</table>
}]
[r,if(formula==""),code:{};{
<table width="170px" style="border:1px solid black;">
<tr>
<td bgcolor=#4C4C4C valign=middle height=20>
<font color=white><b>
Calculator
</td>
</tr><tr>
<td></td>
</tr>
<table width=100% bgcolor=#ece9d8>
<tr>
<td align=right valign=middle bgcolor=#e3dcd1 height=25>
[r:replace(replace(formula,"\\*","x"),"/","÷")]
</td>
</tr><tr>
<td align=right height=35>
<font size=6>
[r:share]
</td>
</tr>
</table>
</table>
}]