Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Due to spam on this forum, all posts now need moderator approval.
Entire forum
➜ MUSHclient
➜ General
➜ Little stuck on this one
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| AaronM86
(42 posts) Bio
|
Date
| Wed 31 Mar 2010 06:57 PM (UTC) |
Message
| ------------------------------------------------------------
7
Prepare these variables: mainMenu, subMenu, craftSac, ingredAmount, itemLevel, Resource, and OtherRes
2
NOTE: OtherRes is only defined if the recipe requires more than one ingredient type and you are using the crafting triggers from the CraftingMultiples groupname.
-----------------------------------------------------------
The above is a world.Note from my MUD World. From the above example, is there a method I can write my the script in my alias to make it so it will not Note the 7 and 2. I've tried several different combinations now, but still can't seem to get it right.
This is the alias I'm using to send the note, it's more or less just a reminder for all the variables I need to define before I start my crafting.
<aliases>
<alias
match="craftcheckup"
enabled="y"
group="Crafting"
send_to="12"
sequence="100"
>
<send>Note (GetNoteColour ())
SetNoteColour (2)
Note ("Prepare these variables: mainMenu, subMenu, craftSac, ingredAmount, itemLevel, Resource, and OtherRes")
Note (GetNoteColour ())
SetNoteColour (3)
Note ("NOTE: OtherRes is only defined if the recipe requires more than one ingredient type and you are using the crafting triggers from the CraftingMultiples groupname.")</send>
</alias>
</aliases>
Any help is greatly appreciated. :D
| Top |
|
Posted by
| AaronM86
(42 posts) Bio
|
Date
| Reply #1 on Thu 01 Apr 2010 02:56 AM (UTC) |
Message
| Nvm, figured this out just by trial and error tinkering. :) | Top |
|
Posted by
| AaronM86
(42 posts) Bio
|
Date
| Reply #2 on Mon 05 Apr 2010 01:52 PM (UTC) |
Message
| Error number: 0
Event: Compile error
Description: [string "Trigger: "]:2: '}' expected (to close '{' at line 1) near '='
Called by: Immediate execution
------------------------------------------------------------
Above is the error I keep getting when this trigger attempts to fire. I can't for the life of me, figure out why it's asking for that. I referenced other similar triggers and everything is set up the same, so I'm not sure what my mistake is here... Below is the trigger:
<triggers>
<trigger
enabled="y"
expand_variables="y"
group="CraftingSockets"
match=" (* Sockets) (*) * Sickle [*]"
send_to="12"
sequence="100"
>
<send>socket_check = {
2 = true,
3 = true,
4 = true,
5 = true,
-- add more here
}
if socket_check [string.lower ("%1")] then
Send("put all.@craftSac Resources")
Send("get @ingredAmount @Resource")
Send("forge @mainMenu @subMenu @Count @itemLevel @Resource")</send>
</trigger>
</triggers>
| Top |
|
Posted by
| AaronM86
(42 posts) Bio
|
Date
| Reply #3 on Mon 05 Apr 2010 04:13 PM (UTC) |
Message
| What I'm trying to do with my last post is sometimes I'll craft items that look like this:
(tiny) a bronze Sickle [4-38 dmg]
(1 Socket) (tiny) a bronze Sickle [4-38 dmg]
(2 Sockets) (tiny) a bronze Sickle [4-38 dmg]
My goal is to keep only the 2 sockets and above then put them in a container and continue to craft. After that sac the 1 socket and no socket items then continue to craft more. | Top |
|
Posted by
| AaronM86
(42 posts) Bio
|
Date
| Reply #4 on Mon 05 Apr 2010 04:38 PM (UTC) |
Message
| Tinkering with all this, I've worked it out to this, but still end up at the same error from the beginning...
<triggers>
<trigger
enabled="y"
expand_variables="y"
group="CraftingSockets"
keep_evaluating="y"
match="^ \((.*?) (.*?)\) \((.*?)\) (.*?) \[(.*?)\]$"
regexp="y"
send_to="12"
sequence="100"
>
<send>socket_check = {
2 = true,
3 = true,
4 = true,
5 = true,
-- add more here
}
socket_checkz = {
Socket = true,
-- add more here
}
if socket_check ("%1") then
Send("put all.@craftSac Resources")
Send("get @ingredAmount @Resource")
Send("forge @mainMenu @subMenu @Count @itemLevel @Resource")
elseif socket_checkz ("%2") then
Send("drop @craftSac")
Send("sac @craftSac")
else
Send("say Woah, something messed up!")
end</send>
</trigger>
</triggers>
Couldn't really figure out how to incorporate when an item has no sockets at all so it's missing a (1 Socket) or (2 Sockets) tag and just shows (tiny) a bronze Sickle [4-38 dmg]. So I also made this trigger and set both to keep evaluating:
<triggers>
<trigger
enabled="y"
expand_variables="y"
group="CraftingSockets"
keep_evaluating="y"
match="^ \((.*?)\) (.*?) \[(.*?) dmg\]$"
regexp="y"
sequence="100"
>
<send>drop @craftSac
sac @craftSac</send>
</trigger>
</triggers>
Another trigger fires when I sacrifice to commence more crafting. Now I still get the original script error, and after that trigger fails the sac trigger continues to sac my sockets I want to keep. Will I need to even re-arrange how I have it set up to match after I figure out my error problems as well? Or will the Socket check function run first and then it will null the other trigger out? | Top |
|
Posted by
| AaronM86
(42 posts) Bio
|
Date
| Reply #5 on Mon 05 Apr 2010 05:10 PM (UTC) |
Message
| Also tried putting it into my script and just running the function from the trigger, but ran into compiling errors... bah, I suck :( Thought I was starting to get a grasp on all this too haha. Sorry, I'm just frustrated with myself now.
function goattea()
socket_check = {
2 = true,
3 = true,
4 = true,
5 = true,
-- add more here
}
socket_none = {
Socket = true,
-- add more here
}
if socket_check ("%1") then
Send("put all.@craftSac Resources")
Send("get @ingredAmount @Resource")
Send("forge @mainMenu @subMenu @Count @itemLevel @Resource")
elseif socket_checkz ("%2") then
Send("drop @craftSac")
Send("sac @craftSac")
else
Send("say Woah, something messed up!")
end
end -- goattea | Top |
|
Posted by
| AaronM86
(42 posts) Bio
|
Date
| Reply #6 on Mon 05 Apr 2010 05:26 PM (UTC) |
Message
| Changed trigger Lua code to this:
<triggers>
<trigger
enabled="y"
expand_variables="y"
group="CraftingSockets"
match="^ \((.*?) (.*?)\) \((.*?)\) (.*?) \[(.*?)\]$"
regexp="y"
send_to="12"
sequence="100"
>
<send> if ("%1 < 1") then
Send("put all.@craftSac Resources")
Send("get @ingredAmount @Resource")
Send("forge @mainMenu @subMenu @Count @itemLevel @Resource")
else
Send("drop @craftSac")
Send("sac @craftSac")
end</send>
</trigger>
</triggers>
Works perfect now, still unclear why it wouldn't work the other way though, I have a say channel trigger set up and written basically the same and it fires correctly. Ah well lol :) Got it to work anyway! | Top |
|
Posted by
| AaronM86
(42 posts) Bio
|
Date
| Reply #7 on Mon 05 Apr 2010 05:45 PM (UTC) |
Message
| if ("%1 < 1") then
Would that equal 1 and greater? Meaning I should use this?:
if ("%1 < 2") then
Since I only want to keep the 2 sockets and higher? | Top |
|
Posted by
| AaronM86
(42 posts) Bio
|
Date
| Reply #8 on Mon 05 Apr 2010 05:50 PM (UTC) |
Message
| <triggers>
<trigger
enabled="y"
expand_variables="y"
group="CraftingSockets"
match="^ \((.*?) (.*?)\) \((.*?)\) (.*?) \[(.*?)\]$"
regexp="y"
send_to="12"
sequence="100"
>
<send>if ("%1 < 2") then
Send("put all.@craftSac Resources")
Send("get @ingredAmount @Resource")
Send("forge @mainMenu @subMenu @Count @itemLevel @Resource")
else
Send("drop @craftSac")
Send("sac @craftSac")
end</send>
</trigger>
</triggers>
I have it set to that now, but it's still putting the (1 Socket) items in the container, instead of sac'ing them as well. Hrm? | Top |
|
Posted by
| AaronM86
(42 posts) Bio
|
Date
| Reply #9 on Mon 05 Apr 2010 05:56 PM (UTC) |
Message
| Changed the else in the middle of the trigger to:
elseif ("%1 > 2") then
Still puts the (1 Socket) items in the container. So confused lol. | Top |
|
Posted by
| AaronM86
(42 posts) Bio
|
Date
| Reply #10 on Mon 05 Apr 2010 06:34 PM (UTC) |
Message
| Noticed I had the > and < in the reverse spots. Re-arranged those but I am still oddly left with the same problem. Putting the 1 sockets into the portal instead of just 2 and above... hrm, so mind boggling lol. | Top |
|
Posted by
| AaronM86
(42 posts) Bio
|
Date
| Reply #11 on Mon 05 Apr 2010 06:37 PM (UTC) |
Message
| I'll be damned! I got it! lol :D
Rewrote it like this to, before I guess it was written incorrectly and just ignoring the ifcheck all together:
if %1 > 1 then
Send ("put all.@craftSac Resources")
Send ("get @ingredAmount @Resource")
Send ("forge @mainMenu @subMenu @Count @itemLevel @Resource")
elseif %1 < 2 then
Send ("drop @craftSac")
Send ("sac @craftSac")
end
Funny how it worked out so simple in the end lol. Sorry for all the random posting. | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
27,830 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top