Search FAQ

Gammon Forum

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.
 Entire forum ➜ MUSHclient ➜ General ➜ many questions about variables/triggers

many questions about variables/triggers

Posting of new messages is disabled at present.

Refresh page


Posted by Manners   (6 posts)  Bio
Date Sat 19 Feb 2022 12:41 PM (UTC)

Amended on Sat 19 Feb 2022 12:45 PM (UTC) by Manners

Message
Hello!

after playing 20 some odd years or so i figured i need to fix some tiggers/variables :)

i have watched and read alot of nicks videos and post but i have some slight issues. ps. i loved the videos

first: i got statusbar to work with targeting etc. but is it possible to use it as a infobar where u can have more then 1 active info at the time? atm i have target shown and after i do some other stuff i get my warnings to go ontop of that so i dont see target anymore? maybe there is a shiftleft shiftright or something? Target: X <- is shown, but when my armourplate repell refresh i have it on same setstatus so it just overwrites the Target until i retarget (still there but just not shown)

2nd im trying to get a consider alias working that consider and save the consider for the day on unique monster id but clear each reboot, in that problem the consider we get looks diffrent amount of adjectives like this:

Weloq is invulnerable to coldness.
Weloq is invulnerable to flames.
Weloq is thoroughly resistant to psionic attacks.
Weloq is invulnerable to suffocation.
Weloq is invulnerable to materia.
Weloq is invulnerable to alkali.
Weloq is thoroughly resistant to blight.
Weloq is vitally resistant to noise.
Weloq is thoroughly resistant to arcane energies.
Weloq is invulnerable to electricity.

and the wanted output i would love is to send it with say first.

Weloq resists:
XXXXXXXXXX Cold
XXXXXXXXXX Fire
XXXXXXXXX. Psio
XXXXXXXXXX Asph
XXXXXXXXXX Phys
XXXXXXXXX. Pois
XXXXXXXX.. Soni
XXXXXXXXX. Magi
XXXXXXXXXX Elec

slightly|somewhat|significantly|greatly|excessively|vastly|vitally|thoroughly|invulnerable
is the resist lists 1-10

and a full resist looks like:
You have finished considering Weloq.
You have a moderate disadvantage in hitpoints compared to Weloq.
You feel how this Weloq has affinity to elemental air.
You consider yourself to have superior protection compared to Weloq.
You judge yourself to have adequate physical qualities compared to Weloq.
You have useful brawn compared to Weloq.
You have basic physical prowess compared to Weloq.
You have moderate constitution compared to Weloq.
Slaying Weloq would decrease your reputation in The Fellowship of Rangers.
You think that Weloq is so strong you can't even compare it to Rixxan, leader of the Brotherhood.
You believe that Weloq is exceptionally mighty in overall power.

Weloq is invulnerable to coldness.
Weloq is invulnerable to flames.
Weloq is vitally resistant to psionic attacks.
Weloq is thoroughly resistant to suffocation.
Weloq is thoroughly resistant to materia.
Weloq is invulnerable to alkali.
Weloq is invulnerable to blight.
Weloq is thoroughly resistant to noise.
Weloq is invulnerable to arcane energies.
Weloq is invulnerable to electricity.

pasted that too, cause sometimes ppl paste resists on channel and dont want it to pick up and spam that too, but i would love the saved consider so I can spam it more then once if needed and even better if can choose if to spam on say or party say or other channels.

best regards //manners
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #1 on Sun 20 Feb 2022 09:35 PM (UTC)

Amended on Sun 20 Feb 2022 09:38 PM (UTC) by Fiendish

Message
Quote:
first: i got statusbar to work with targeting etc. but is it possible to use it as a infobar where u can have more then 1 active info at the time?

Only manually. The statusbar is just a simple text field that anything can write to. If you want multiple messages to show at the same time, you need to cobble together substrings before sending the message to status.

For instance, if you want to add a new message to the status area that only occupies character locations 31 through 50 without affecting the rest of the status text, you'd need to do something like...


current_status_text = GetInfo(53)
new_message = "this is the new message"
new_message_to_fill_20_spaces = string.format("%-20s", new_message:sub(1,20))
first_part_of_current_status_to_fill_30_spaces = string.format("%-30s", current_status_text:sub(1,30))
SetStatus(first_part_of_current_status_to_fill_30_spaces .. new_message_to_fill_20_spaces .. current_status_text:sub(51))


Note that since I've only allocated 20 spaces for the new message, it gets truncated to just "this is the new mess".


Quote:
2nd im trying to get a consider alias working

Ok, so what are the problems with what you've tried so far?

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Manners   (6 posts)  Bio
Date Reply #2 on Mon 21 Feb 2022 12:48 AM (UTC)
Message
nice ill check that after some sleep, but first ill stick me head out and look dumb to show what i first tried with consider alias.

i made trigger for each type like this:

* is * * to electricity.
con_id = "%1"
cons_elec = "%2"

then i made an alias with 10 lines of each type like this:

Send say (con_id) is (cons_elec) to electricity.

strange this is i get it to /print con_id and cons_elec
but cant pick up the variable to send say

//Manners
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #3 on Mon 21 Feb 2022 03:36 AM (UTC)
Message
Template:what Please help us by showing:
  • A copy of the trigger, alias or timer you were using (see Copying XML)
  • The error message, if any, that you got

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Manners   (6 posts)  Bio
Date Reply #4 on Mon 21 Feb 2022 04:17 AM (UTC)
Message
<triggers>
<trigger
custom_colour="3"
enabled="y"
match="* is * * to alkali."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_acid = "%2"
con_ex = "%3"</send>
</trigger>
</triggers>

<triggers>
<trigger
custom_colour="14"
enabled="y"
match="* is * * to arcane energies."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_mag = "%2"
con_ex = "%3"</send>
</trigger>
</triggers>

<triggers>
<trigger
custom_colour="15"
enabled="y"
match="* is * * to blight."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_pois = "%2"
con_ex = "%3"</send>
</trigger>
</triggers>

<triggers>
<trigger
custom_colour="5"
enabled="y"
match="* is * * to coldness."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_cold = "%2"
con_ex = "%3"</send>
</trigger>
</triggers>


<triggers>
<trigger
custom_colour="2"
enabled="y"
match="* is * * to electricity."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_elec = "%2"
con_ex = "%3"</send>
</trigger>
</triggers>

<triggers>
<trigger
custom_colour="7"
enabled="y"
match="* is * * to flames."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_fire = "%2"
con_ex = "%3"</send>
</trigger>
</triggers>

<triggers>
<trigger
custom_colour="10"
enabled="y"
match="* is * * to materia."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_phys = "%2"
con_ex = "%3"</send>
</trigger>
</triggers>

<triggers>
<trigger
custom_colour="11"
enabled="y"
match="* is * * to noise."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_sonic = "%2"
con_ex = "%3"</send>
</trigger>
</triggers>

<triggers>
<trigger
custom_colour="6"
enabled="y"
match="* is * * to psionic attacks."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_psi = "%2"
con_ex = "%3"</send>
</trigger>
</triggers>

<triggers>
<trigger
custom_colour="12"
enabled="y"
match="* is * * to suffocation."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_asph = "%2"
con_ex = "%3"</send>
</trigger>
</triggers>

<aliases>
<alias
match="eqcon"
enabled="y"
send_to="12"
sequence="100"
>
<send>Send say (con_id) is (cons_acid) to alkali.
Send say (con_id) is (cons_asph) to suffocation.
Send say (con_id) is (cons_cold) to coldness.
Send say (con_id) is (cons_elec) to electricity.
Send say (con_id) is (cons_fire) to flames.
Send say (con_id) is (cons_mag) to arcane energies.
Send say (con_id) is (cons_phys) to materia.
Send say (con_id) is (cons_pois) to blight.
Send say (con_id) is (cons_psi) to psionic attacks.
Send say (con_id) is (cons_sonic) to noise.</send>
</alias>
</aliases>


tried to also to add con_ex cause i cant figure out how to get the wildcards right, also tried to add all this into variables but seems its not right way to go since all made to scriped and not to varirables.

//Mannners
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #5 on Mon 21 Feb 2022 04:52 AM (UTC)
Message
Quote:
Send say (con_id) is (cons_asph) to suffocation.

Won't work because Send needs a string.
Look at the examples on https://www.mushclient.com/scripts/doc.php?function=Send

What if you try

Send("say ("..con_id..") is ("..cons_asph..") to suffocation")

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Manners   (6 posts)  Bio
Date Reply #6 on Mon 21 Feb 2022 07:57 AM (UTC)
Message
also just figured another problem, if i consider target "weloq" and it saves him on con_id and all the resists on cons_type
next monster i consider will save on its right cons_id but all the cons_type will oversave on that variable.. hmm

i think im attacking this the wrong way.
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #7 on Mon 21 Feb 2022 03:36 PM (UTC)

Amended on Mon 21 Feb 2022 03:38 PM (UTC) by Fiendish

Message
Then try using a table for your storage.

my_storage = {}


Then in each trigger put

con_id = "%1"
cons_fire = "%2"
my_storage[con_id] = my_storage[con_id] or {}
my_storage[con_id]["fire"] = cons_fire

And so on.

Also your trigger patterns should not use "* *". Only put one asterisk there because "invulnerable" is only one word, not two.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Manners   (6 posts)  Bio
Date Reply #8 on Tue 22 Feb 2022 09:07 PM (UTC)
Message
ok.. hmm

<triggers>
<trigger
custom_colour="2"
enabled="y"
group="consider"
match="* is * to alkali."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_acid = "%2"
my_storage[con_id] = my_storage[con_id] or {}
my_storage[con_id]["acid"] = cons_acid</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
group="consider"
match="* is * to arcane energies."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_mag = "%2"
my_storage[con_id] = my_storage[con_id] or {}
my_storage[con_id]["mag"] = cons_mag</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
group="consider"
match="* is * to blight."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_pois = "%2"
my_storage[con_id] = my_storage[con_id] or {}
my_storage[con_id]["pois"] = cons_pois</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
group="consider"
match="* is * to coldness."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_cold = "%2"
my_storage[con_id] = my_storage[con_id] or {}
my_storage[con_id]["cold"] = cons_cold</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
group="consider"
match="* is * to electricity."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_elec = "%2"
my_storage[con_id] = my_storage[con_id] or {}
my_storage[con_id]["elec"] = cons_elec</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
group="consider"
match="* is * to flames."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_fire = "%2"
my_storage[con_id] = my_storage[con_id] or {}
my_storage[con_id]["fire"] = cons_fire</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
group="consider"
match="* is * to materia."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_phys = "%2"
my_storage[con_id] = my_storage[con_id] or {}
my_storage[con_id]["phys"] = cons_phys</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
group="consider"
match="* is * to noise."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_sonic = "%2"
my_storage[con_id] = my_storage[con_id] or {}
my_storage[con_id]["sonic"] = cons_sonic</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
group="consider"
match="* is * to psionic attacks."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_psi = "%2"
my_storage[con_id] = my_storage[con_id] or {}
my_storage[con_id]["psi"] = cons_psi</send>
</trigger>
<trigger
custom_colour="2"
enabled="y"
group="consider"
match="* is * to suffocation."
send_to="12"
sequence="100"
>
<send>con_id = "%1"
cons_asph = "%2"
my_storage[con_id] = my_storage[con_id] or {}
my_storage[con_id]["asph"] = cons_asph</send>
</trigger>
</triggers>


<aliases>
<alias
match="eqcon"
enabled="y"
send_to="12"
sequence="100"
>
<send>Send("say ("..con_id..") is ("..cons_acid..") to alkali.")
Send("say ("..con_id..") is ("..cons_asph..") to suffocation")
Send("say ("..con_id..") is ("..cons_cold..") to coldness.")
Send("say ("..con_id..") is ("..cons_elec..") to electricity.")
Send("say ("..con_id..") is ("..cons_fire..") to flames.")
Send("say ("..con_id..") is ("..cons_mag..") to arcane energies.")
Send("say ("..con_id..") is ("..cons_phys..") to materia.")
Send("say ("..con_id..") is ("..cons_pois..") to blight.")
Send("say ("..con_id..") is ("..cons_psi..") to psionic attacks.")
Send("say ("..con_id..") is ("..cons_sonic..") to noise.")</send>
</alias>
</aliases>


now i got:

Run-time error
World: icesus
Immediate execution
[string "Trigger: "]:3: attempt to index global 'my_storage' (a nil value)
stack traceback:
[string "Trigger: "]:3: in main chunk


but when i print (con_id) or (cons_type) i see it capture it atleast.


//Manners
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #9 on Tue 22 Feb 2022 09:15 PM (UTC)

Amended on Tue 22 Feb 2022 09:26 PM (UTC) by Fiendish

Message
You need to either have somewhere outside of your triggers

my_storage = {}


Or you could start each of your triggers with

my_storage = my_storage or {}


You can't look inside of a table that doesn't exist, so you have to make it exist.

https://github.com/fiendish/aardwolfclientpackage
Top

Posted by Manners   (6 posts)  Bio
Date Reply #10 on Tue 22 Feb 2022 09:37 PM (UTC)

Amended on Tue 22 Feb 2022 10:26 PM (UTC) by Manners

Message
ok that did it with the trigger, but alias still gives:

Run-time error
World: icesus
Immediate execution
[string "Alias: "]:1: attempt to call global 'Send' (a string value)
stack traceback:
[string "Alias: "]:1: in main chunk




also if i /print (my_storage) it shows table: 05A81128

maybe thats of any help


now i edit next stupid thing: my alias was just eqcon, but shouldnt it be like eqcon * or eqcon [cons_id] or something? since the whole point i want to store up the lastest consider and can spam it out when needed without taking new consider.

//Manners
Top

Posted by Fiendish   USA  (2,533 posts)  Bio   Global Moderator
Date Reply #11 on Tue 22 Feb 2022 10:26 PM (UTC)

Amended on Tue 22 Feb 2022 10:29 PM (UTC) by Fiendish

Message
You have two problems, one I can see and one I can't see.

The one I can see is that if you're using tables for storage in your triggers, you need to also use the same table entries in your alias.
my_storage[con_id]["acid"] = cons_acid

is not compatible with
Send("say ("..con_id..") is ("..cons_acid..") to alkali.")


You want to be looking at my_storage[con_id]["acid"] not at cons_acid there.

The one I can't see is that the only possible cause for
Quote:
attempt to call global 'Send' (a string value)

is if you have replaced the Send function with a string.

You should definitely put this all into a plugin so that you're not affected by anything else in your global script file.

https://github.com/fiendish/aardwolfclientpackage
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.


17,812 views.

Posting of new messages is disabled at present.

Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.