Mudlet Questions

by Rika

Back to Mechanic's Corner.

Vadi2012-05-11 21:14:51
The new module system that you have in the toolbox menu syncs modules across all profiles within the same instance of Mudlet when you save.

@gagging: http://t.co/4MqPfbEV
Unknown2012-05-12 00:36:47
Vadi:

The new module system that you have in the toolbox menu syncs modules across all profiles within the same instance of Mudlet when you save.

@gagging: http://t.co/4MqPfbEV


I'm feeling particularly nooby today - I can't find the aforementioned toolbox menu or mention of modules.

I'm on 2.0test4b - it's probably right under my nose.
Unknown2012-05-12 14:27:48
You may have to turn the menu on. It's in settings, general. Show menu bar. Then you should have the toolbox menu, and within it the module manager
Unknown2012-05-20 23:56:59
Does anyone have any autorazer/cleaver at all for mudlet for use by a warrior? Thanks!
Daganev2012-05-21 06:22:08
Xyas:

Does anyone have any autorazer/cleaver at all for mudlet for use by a warrior? Thanks!


This is what I used when I had bonecrusher active.

I leave the trigger lines to activate the variables up to you.


if attackOne == nil then attackOne = "raze" end
if attackTwo == nil then attackTwo = "raze" end
if needToRazeRebounding == nil then needToRazeRebounding = 1 end
if needToRazeShield == nil then needToRazeShield = 1 end
if needToRazeRebounding == 1 then attackOne = "raze "..target end
if needToRazeShield == 1 then attackTwo = "raze "..target end
if needToRazeRebounding == 0 then attackOne = "Jab "..target; end
if needToRazeShield == 0 then attackTwo = "jab "..target; end
send("sm insert 1 "..attackOne.."|"..attackTwo)


Now for bashing, I just use this:

send("sm add beast order attack "..target.."|".."cleave "..target)
Unknown2012-05-21 20:06:18
daganev:



This is what I used when I had bonecrusher active.

I leave the trigger lines to activate the variables up to you.


if attackOne == nil then attackOne = "raze" end
if attackTwo == nil then attackTwo = "raze" end
if needToRazeRebounding == nil then needToRazeRebounding = 1 end
if needToRazeShield == nil then needToRazeShield = 1 end
if needToRazeRebounding == 1 then attackOne = "raze "..target end
if needToRazeShield == 1 then attackTwo = "raze "..target end
if needToRazeRebounding == 0 then attackOne = "Jab "..target; end
if needToRazeShield == 0 then attackTwo = "jab "..target; end
send("sm insert 1 "..attackOne.."|"..attackTwo)


Now for bashing, I just use this:

send("sm add beast order attack "..target.."|".."cleave "..target)


So I'd add this to everyone of my aliases and change the jab to say jab target lleg?
Daganev2012-05-22 08:53:16
Xyas:

So I'd add this to everyone of my aliases and change the jab to say jab target lleg?

No, I wouldn't recommend that for something more complex. Instead I would do this:
function razeOrAttack(attackString)
if needToRazeShield ==1 or needToRazeRebounding == 1 then
send("sm insert raze "..target)
else
send(attackString)
end
end

Then to use it, you would put in your alias.
razeOrAttack("jab "..target.." lleg")
or if you make use of strategems
razeOrAttack("sm insert jab "..target.." lleg")
Unknown2012-05-22 18:38:54
daganev:


This is what I used when I had bonecrusher active.

I leave the trigger lines to activate the variables up to you.


if attackOne == nil then attackOne = "raze" end
if attackTwo == nil then attackTwo = "raze" end
if needToRazeRebounding == nil then needToRazeRebounding = 1 end
if needToRazeShield == nil then needToRazeShield = 1 end
if needToRazeRebounding == 1 then attackOne = "raze "..target end
if needToRazeShield == 1 then attackTwo = "raze "..target end
if needToRazeRebounding == 0 then attackOne = "Jab "..target; end
if needToRazeShield == 0 then attackTwo = "jab "..target; end
send("sm insert 1 "..attackOne.."|"..attackTwo)


Now for bashing, I just use this:

send("sm add beast order attack "..target.."|".."cleave "..target)



So all of this would go into a trigger basically to turn on the razeorattack function, and the other stuff goes in an alias. Then if I wanted to turn the razeorattack back off I'd have to make another trigger with the above stuff reversed (0's 1's and 1's 0's?) Sorry, not good at this coding stuff at all, still trying to learn.
Lilia2012-05-22 20:17:46
I would recommend using true and false instead of 1 and 0, because it makes more sense intuitively. needToRazeRebounding = true, you automatically know what that means, needToRazeRebounding = 1, you have to think about for a second.
Daganev2012-05-22 20:19:10
Xyas:



So all of this would go into a trigger basically to turn on the razeorattack function, and the other stuff goes in an alias. Then if I wanted to turn the razeorattack back off I'd have to make another trigger with the above stuff reversed (0's 1's and 1's 0's?) Sorry, not good at this coding stuff at all, still trying to learn.


Not quite. The first big block of code is really only for bashing, where you are using simple jabs or swings for your attacks and don't care about much of anything else.

For more complicated things like targeting different body parts, use the razeOrAttack function.in your aliases whereever you would normally use the send function for your attacks. The razeOrAttack function will either do a raze, or it will send your attack if you don't need to raze anything.

Edit: And What Lilia says is also true.0 and 1 is me being lazy
Unknown2012-05-23 02:19:54
daganev:

No, I wouldn't recommend that for something more complex. Instead I would do this:
function razeOrAttack(attackString)
if needToRazeShield ==1 or needToRazeRebounding == 1 then
send("sm insert raze "..target)
else
send(attackString)
end
end

Then to use it, you would put in your alias.
razeOrAttack("jab "..target.." lleg")
or if you make use of strategems
razeOrAttack("sm insert jab "..target.." lleg")


Does that function go in the scripts section?
Daganev2012-05-23 04:54:17
The function definition goes in the scripts, the two examples.of how to use it go in the aliasess
Unknown2012-05-23 05:36:26
Lilia:

I would recommend using true and false instead of 1 and 0, because it makes more sense intuitively. needToRazeRebounding = true, you automatically know what that means, needToRazeRebounding = 1, you have to think about for a second.


There is absolutely -no- difference between true/false and 1/0.
Daganev2012-05-23 07:14:43
Draylor:


There is absolutely -no- difference between true/false and 1/0.


There is a big difference. Readability.

It's the difference between this function:


function ×—(l)
if ל == 1 or ט == 1 then
send("sm insert raze "..ו)
else
send(l)
end
end


And this one:


function razeOrAttack(attackString)
if needToRazeShield == true or needToRazeRebounding == true then
send("sm insert raze "..target)
else
send(attackString)
end
end



However, I just realized that unless carefully handled the current code will cause you to always raze twice, which you don't want. So fix that I suggest the following code instead.

function razeOrAttack(attackString)
if needToRazeShield == true and needToRazeRebounding == true then
send( "sm insert raze "..target.."|raze "..target)
elseif needToRazeSheild == true or needToRazeRebounding == true then
send("sm insert raze "..target.."|"..attackString)
else
send("sm insert "..attackString.."|"..attackString)
end
end

This assumes both attacks are the same attack to the same target and bodypart.
However, if you want to do two different attacks then just change the function to this.

function razeOrAttack(rightAttackString, leftAttackString)
if needToRazeShield == true and needToRazeRebounding == true then
send( "sm insert raze "..target.."|raze "..target)
elseif needToRazeSheild == true or needToRazeRebounding == true then
send("sm insert raze "..target.."|"..rightAttackString)
else
send("sm insert "..rightAttackString.."|"..leftAttackString)
end
end
Unknown2012-05-23 10:43:59
There is a difference between true/false and 0/1, more than just readability.
Daganev2012-05-23 11:03:30
Zarquan:

There is a difference between true/false and 0/1, more than just readability.

does lua convert 0 1 to a bit or to a int?
Unknown2012-05-23 11:43:24
They are integers, and "if 0 then print('blah') end" will print "blah" because 0 evaluates to true in an expression. Only false and nil evaluate as not true in a conditional.

For rebounding and shield, I use nil for "unknown," false for "definitely down," and true for "definitely up."
Unknown2012-05-23 13:09:50
Using true false also allows you to simplify your if statements, changing

if thisThing == 1 then

or

if thisThing == true then

to

if thisThing then


Which increases readability further. imo. For some reason though, 0, 1, and 1.5 seem to be used rather heavily in MUD scripting.
Unknown2012-05-24 03:35:09
what does the "|" ..attack string do?

function razeOrAttack(attackString)
if needToRazeShield == true and needToRazeRebounding == true then
send( "sm insert raze "..target.."|raze "..target)
elseif needToRazeSheild == true or needToRazeRebounding == true then
send("sm insert raze "..target.."|"..attackString)
else
send("sm insert "..attackString.."|"..attackString)
end
end
Unknown2012-05-24 03:43:14
Also what do I add to a trigger to change things to make it know whether a person needs razing or not?