Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
crisis
Beginner


Joined: 15 Aug 2007
Posts: 10

PostPosted: Thu Aug 23, 2007 12:34 am   

How to make a List Summon
 
Ok this is what I am trying to make but I honestly don't know how to do it.

I want to make a trigger that summons a mob every tick and kills it.

But this is the issue. I want it to switch targets once it can't find a certain mob.

For example:

Trigger Pattern: -- TICK!
Trigger Value: c 'summon' bozak

but I want it to be able to switch targets if the mud sends the response.

You failed.

this is how I wish it would work.

-- TICK!
c 'summon' bozak
You failed.
c 'summon' mall
A mall rat arrives suddenly.
kill mall

that way it auto changes mobs if the summon fails.

Thanks.

I hope you all can help me. Someone told me to use a List and another said make an array.
The only problem with those solutions is I have never made either one. I have no clue how to.

Please help if you can.

Anything is better than the crap I made.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Aug 23, 2007 12:40 am   
 
This is totally untested and written off the top of my head. Just copy and paste into the commandline and you should be able to start going. Add all your targets with the AddSTarget alias. As soon as you put your first target in it will activate the bot. You can then turn the bot on and off with just the SumBot alias. Finally it includes a 30 second rest state when it runs out of things to kill. Also included is a state to keep from summoning many things and only killing 1. You may have to correct the text for that since you didn't supply it initially.
Code:
#CLASS SummonBot
#VAR SummonTargets {}
#VAR SummonTarget {} {}
#VAR InCombat {0} {0}
#VAR FailCount {0} {0}
#ALIAS AddSTarget {#ADDITEM SummonsTargets {%1};#IF (%trigger(SummonTime)=0) {#T+ SummonTime}}
#ALIAS SumBot {#IF (%trigger(SummonTime)) {#STATE SummonTime 0;#T- SummonTime;InCombat=0} {T+ SummonTime}}
#ALIAS DoSummon {#IF (%numitems(@SummonsTargets)) {#IF (@SummonTarget) {c 'summon' @SummonTarget} {#IF (@FailCount>=%numitems(@SummonTargets)) {#SHOW {All targets demolished engaging delay.};#T+ SummonRest;InCombat=1;rest} {SummonTarget=%item(@SummonTargets,1);c 'summon' @SummonTarget}}} {#STATE SummonTime 0;InCombat=0;#T- SummonTime}
#TRIGGER "SummonTime" {^--TICK!$} {#IF (@InCombat=0) {DoSummon}} "" {disable}
#COND {^(?:(?:A|An|The) .*? arrives suddenly.|You failed.)} {#IF (%line="You failed.") {#ADD FailCount 1;SummonTarget=%item(@SummonTargets,%eval(%ismember(@SummonTarget,@SummonTargets)+1));#STATE SummonTime 1;DoSummon} {InCombat=1;kill @SummonTarget}} {regex}
#COND {^You have killed} {InCombat=0}
#ALARM "SummonRest" {*30} {stand;#T- SummonRest} "" {disable}
#CLASS 0
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
crisis
Beginner


Joined: 15 Aug 2007
Posts: 10

PostPosted: Thu Aug 23, 2007 5:28 am   Giving me an Access Violation
 
Access violation at address 004BDAB4 in module 'Zmud.exe'. Read of address 756E254D.
Reply with quote
crisis
Beginner


Joined: 15 Aug 2007
Posts: 10

PostPosted: Thu Aug 23, 2007 5:34 am   
 
But this is exactly what I do want to make. And for some reason when I do get it in the DoSummon just shows up like this.

Alias Name: DoSummon
Alias Value: {#IF

Nothing else. Exactly like that.

BTW, I play Temporal Rifts if you would like to test it. Thanks alot I really do appreciate this.

Crisis
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Thu Aug 23, 2007 1:42 pm   
 
It was just missing a closing brace. You should probably check that everything else pasted in alright as well.
Code:
#ALIAS DoSummon {#IF (%numitems(@SummonsTargets)) {#IF (@SummonTarget) {c 'summon' @SummonTarget} {#IF (@FailCount>=%numitems(@SummonTargets)) {#SHOW {All targets demolished engaging delay.};#T+ SummonRest;InCombat=1;rest} {SummonTarget=%item(@SummonTargets,1);c 'summon' @SummonTarget}}} {#STATE SummonTime 0;InCombat=0;#T- SummonTime}}

_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
charneus
Wizard


Joined: 19 Jun 2005
Posts: 1876
Location: California

PostPosted: Thu Aug 23, 2007 4:47 pm   
 
As always, make sure this trigger isn't breaking any MUD rules. Many MUDs do not allow the use of a bot in which you can be away from your keyboard for any length of time and your character will continue to run in an automated sequence. Please note that you are responsible for your character and any consequences rendered to your character for any illegal activities. ;)

Charneus
Reply with quote
crisis
Beginner


Joined: 15 Aug 2007
Posts: 10

PostPosted: Fri Aug 24, 2007 12:06 am   Ok problem with the setup
 
I have it in now. But for some reason the Tick trigger and the Cond trigger keep deleting. On their own. And everything is being thrown in one folder. I hope I didn't do it wrong.

Thanks,

Crisis
Reply with quote
crisis
Beginner


Joined: 15 Aug 2007
Posts: 10

PostPosted: Fri Aug 24, 2007 12:14 am   
 
These three I am having issues with:

#TRIGGER "SummonTime" {^--TICK!$} {#IF (@InCombat=0) {DoSummon}} "" {disable}
#COND {^(?:(?:A|An|The) .*? arrives suddenly.|You failed.)} {#IF (%line="You failed.") {#ADD FailCount 1;SummonTarget=%item(@SummonTargets,%eval(%ismember(@SummonTarget,@SummonTargets)+1));#STATE SummonTime 1;DoSummon} {InCombat=1;kill @SummonTarget}} {regex}
#COND {^You have killed} {InCombat=0}

And if I stick them in manually, they disappear after 1 kill and make a new trigger named: You have killed.

I am not sure where the problem could be and also the @InCombat=0 changes after 1 kill to @InCombat=1 and I have to go back in manually and replace all the above and reset InCombat to 0

Hope this helps some.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Aug 24, 2007 12:41 am   
 
This is likely caused by the original error of a missing closing brace. Also I did mention that you have to adjust the "^You have killed" pattern to correctly match something indicating the completeion of fight. I will put the whole together with a #DELCLASS so it cleans up anything you have right now. You will have to add your targets in again. Please take the time to actually try to understand how the script works.
Code:
#DELCLASS SummonBot
#CLASS SummonBot
#VAR SummonTargets {}
#VAR SummonTarget {} {}
#VAR InCombat {0} {0}
#VAR FailCount {0} {0}
#ALIAS AddSTarget {#ADDITEM SummonsTargets {%1};#IF (%trigger(SummonTime)=0) {#T+ SummonTime}}
#ALIAS SumBot {#IF (%trigger(SummonTime)) {#STATE SummonTime 0;#T- SummonTime;InCombat=0} {T+ SummonTime}}
#ALIAS DoSummon {#IF (%numitems(@SummonsTargets)) {#IF (@SummonTarget) {c 'summon' @SummonTarget} {#IF (@FailCount>=%numitems(@SummonTargets)) {#SHOW {All targets demolished engaging delay.};#T+ SummonRest;InCombat=1;rest} {SummonTarget=%item(@SummonTargets,1);c 'summon' @SummonTarget}}} {#STATE SummonTime 0;InCombat=0;#T- SummonTime}}
#TRIGGER "SummonTime" {^--TICK!$} {#IF (@InCombat=0) {DoSummon}} "" {disable}
#COND {^(?:(?:A|An|The) .*? arrives suddenly.|You failed.)} {#IF (%line="You failed.") {#ADD FailCount 1;SummonTarget=%item(@SummonTargets,%eval(%ismember(@SummonTarget,@SummonTargets)+1));#STATE SummonTime 1;DoSummon} {InCombat=1;kill @SummonTarget}} {regex}
#COND {^You have killed} {InCombat=0}
#ALARM "SummonRest" {*30} {stand;#T- SummonRest} "" {disable}
#CLASS 0
_________________
The only good questions are the ones we have never answered before.
Search the Forums
Reply with quote
crisis
Beginner


Joined: 15 Aug 2007
Posts: 10

PostPosted: Fri Aug 24, 2007 5:04 am   I understand the basics behind it. Just need to study it more.
 
But I am still having one problem.

#COND {^(?:(?:A|An|The) .*? arrives suddenly.|You failed.)} {#IF (%line="You failed.") {#ADD FailCount 1;SummonTarget=%item(@SummonTargets,%eval(%ismember(@SummonTarget,@SummonTargets)+1));#STATE SummonTime 1;DoSummon} {InCombat=1;kill @SummonTarget}} {regex}
#COND {is DEAD!!$} {InCombat=0}

Those two lines don't get put in the system.

I am using Zmud 7.21

Not sure if it can't accept those values. For some reason when I copy and paste the whole Text and then open the class folder and hit all to see everything, they are no where to be found. I also have show hidden on and details and no where. Is it suppose to be that way? I also added the mud specific text in to the 2nd Condition.

Thanks,

Crisis.
Reply with quote
Tech
GURU


Joined: 18 Oct 2000
Posts: 2733
Location: Atlanta, USA

PostPosted: Fri Aug 24, 2007 9:24 am   
 
Those lines have to be put in at the same time as the trigger statement before them.

See #CONDITION for more help.
_________________
Asati di tempari!
Reply with quote
Arminas
Wizard


Joined: 11 Jul 2002
Posts: 1265
Location: USA

PostPosted: Fri Aug 24, 2007 12:48 pm   
 
They also don't show as normal triggers in the editor. They are STATES of the trigger before them as Tech mentioned.
With that in mind you need to click on the trigger before them and click the states tab to be able to see them.

I just copied the above script and pasted it into the command line and they showed up exactly where I said for you to look, under the states tab of the ^--TICK!$ trigger.
_________________
Arminas, The Invisible horseman
Windows 7 Pro 32 bit
AMD 64 X2 2.51 Dual Core, 2 GB of Ram
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net