Register forum user name 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.

Due to spam on this forum, all posts now need moderator approval.

 Entire forum ➜ MUDs ➜ General ➜ Walking Script

Walking Script

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Yezrah   (4 posts)  Bio
Date Sat 24 Feb 2018 03:45 AM (UTC)

Amended on Sat 24 Feb 2018 03:51 AM (UTC) by Yezrah

Message
I'm sorry to make a new thread post, I hope this is my last one. I have most of this scripting thing working.

However, I don't know how to create a script that runs like this..

if ((orc isin $1-)) && (standing isin $1-) { timer 1 1 sockwrite -n client.sock kill orc }
if ((orc isin $1-)) && (dies isin $1-) {
if ((%walk 1)) { timer 1 1 sockwrite -n client.sock go east }
if ((%walk 2)) { timer 1 1 sockwrite -n client.sock go south }
if ((%walk 3)) { timer 1 1 sockwrite -n client.sock go se }

if (you arrive isin $1) { inc %walk1
if ((%walk 1)) { timer 1 1 sockwrite -n client.sock go east }
if ((%walk 2)) { timer 1 1 sockwrite -n client.sock go south }
if ((%walk 3)) { timer 1 1 sockwrite -n client.sock go se }
}

Ok... something like this as an example of trying to explain what I want to do on Mushclient, using the only language i vaguely know...

I would like to be able to set up a walk pattern, perhaps, N, S, E, W, S, N, W, E, N(repeat) walking in a X intersection area.... killing mobs in each of these 5 paces as I go back and forth between the rooms.

I have no idea how to do it fluidly and clean and faultless...

I have a very sloppy system right now, where I created go e, and if e is not in, then go se, if se is not in, go s, and it's like one of those vacuum bots.. running around sweeping up mobs right now....

I'd like more intelligence in my mushclient script writing....

my fingers are getting too old to grind on muds like when i was a kid..... due to some arthritis in my right pinky finger (enter key finger) from a boxer's fracture i got when i was a teen... I need a program enter stuff for me.

any video links that anyone knows about if this has ever been brought up before... or any explanations would be great. Appreciate it.
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #1 on Sat 24 Feb 2018 04:36 AM (UTC)
Message
Rather than trying to code in a script language I have never seen, how about posting some example code/response? That would make it easier to visualize.

eg.


  • Send: N
  • Receive: (something that indicates you have gone north)
  • If you see: An orc is standing here.
  • Then send: kill orc
  • And wait for: You kill * orc.

  • If no orc, or once the orc is dead, go S and repeat the process

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #2 on Sat 24 Feb 2018 04:39 AM (UTC)
Message
Or, copy/paste a few dozen lines of you actually doing it.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Fiendish   USA  (2,535 posts)  Bio   Global Moderator
Date Reply #3 on Sat 24 Feb 2018 04:13 PM (UTC)

Amended on Sat 24 Feb 2018 04:25 PM (UTC) by Fiendish

Message
if ((orc isin $1-)) && ((standing isin $1-)) then { ... }

For this you would make a trigger that matches on text including both the words "orc" and "standing". ( Read https://www.gammon.com.au/forum/?id=8086 and https://www.gammon.com.au/mushclient/funwithtriggers.htm )


timer 1 1 sockwrite -n client.sock kill orc

Sending basic commands after a delay is done with the DoAfter script function, like DoAfter(1, "kill orc") ( Read https://www.gammon.com.au/scripts/doc.php?function=DoAfter ).
To use that function your trigger will need to send to Script ( Search for "Send to:" at https://www.gammon.com.au/scripts/doc.php?dialog=IDD_EDIT_TRIGGER )


if ((%walk 1))
and
inc %walk
will depend on which scripting language you use. We generally recommend Lua.

In Lua they could be something like
if tonumber(GetVariable("walk")) == 1 then

and
SetVariable("walk", tonumber(GetVariable("walk"))+1)

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

Posted by Yezrah   (4 posts)  Bio
Date Reply #4 on Fri 02 Mar 2018 10:59 PM (UTC)

Amended on Fri 02 Mar 2018 11:01 PM (UTC) by Yezrah

Message
someone from a mud told me the language i know how to script write in is called Visual Basic....

I didn't know because I didn't go to school for it, i just took some scrips that existed already in this scripter on mIRC client that was passed around on this game i played....

and opened it up and began messing around with it until I learned how to write my own script with it.... with lots and lots of errors and starting over, and... took a few days of hairpulling stress to learn to do it....

But, learning to read a language is easy.... if the language is there.

but... i dont know some of the commands like kill orc *

If I saw that in a script.. I would eventually figure it out...

But if i never seen it before, i would never know to try to enter it to see what it did....
Top

Posted by Nick Gammon   Australia  (23,140 posts)  Bio   Forum Administrator
Date Reply #5 on Sat 03 Mar 2018 05:39 AM (UTC)
Message
Maybe look at my tutorial about scripting basics:

http://www.gammon.com.au/forum/?id=10212

- Nick Gammon

www.gammon.com.au, www.mushclient.com
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.


19,697 views.

It is now over 60 days since the last post. This thread is closed.     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.