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
➜ VBscript
➜ Need a script for space travel in a swr mud
Need a script for space travel in a swr mud
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Madrox
(40 posts) Bio
|
Date
| Sun 11 Dec 2005 02:41 PM (UTC) |
Message
| Hi, not sure if this is how i go about it but I need a script to search uncharted space in a swr mud. Basicly I want to put in two sets of coords into the script ie '100 100' and '200 200' and have it search everywhere in between one by one. The commands would be "Calc 'x y'" then the out put would be
"The ship lurches slightly as it comes out of hyperspace."
After that message id like it to move on to the next sector. If possible id like it to go from '100 100' to '100 101' then '100 102' and so on. And when it reaches 100 200 it would roll over to 101 100 and so on again. If anyone could help me out that would be wonderful. Thanks a lot in advance | Top |
|
Posted by
| Madrox
(40 posts) Bio
|
Date
| Reply #1 on Sun 11 Dec 2005 08:05 PM (UTC) |
Message
| Also, if no one is able to write one for me. Could someone direct me to a site that would teach me how to write the script. I looked over a script that Flannel wrote for the same mud, but it all looks like jibberish to me. So any guideance would be very nice. Thanks. | Top |
|
Posted by
| Madrox
(40 posts) Bio
|
Date
| Reply #2 on Sun 11 Dec 2005 08:54 PM (UTC) |
Message
| Alright, I tried using the example scripts posted on this site. But it says "You have not specified a file name:
The Alias (OnTeleport)subroutine "OnTeleport" could not be found"
So I dont know what i did wrong any suggestions *sigh* its been a long day heh | Top |
|
Posted by
| Madrox
(40 posts) Bio
|
Date
| Reply #3 on Mon 12 Dec 2005 01:43 PM (UTC) |
Message
| Alright, after thinking about the problem for a while, ive figured out I can do it with triggers. But I dont know the syntax. It would be something like. (match this)
The ship lurches slightly as it comes out of hyperspace.
then send NAV then the read out from NAV is like.
Readout for BR-23 Public Transport BC120:
---------------------------------------------------------
Current Coordinates: 3338 -6445 -9670
Current Heading: 1 1 -1
Current Speed: 75/75
--Location-----------------------------------------------
Current System: Roche Sector
Current System X/Y: (-55, -6)
--Hyperspace---------------------------------------------
(No hyperspace trajectory is locked right now)
But i only need the Current System X/Y: (-55, -6)
from there I would do either +1 or -1 and there is my problem. How do I tell the trigger to add one to a number it would be like Current System X/Y: (*, *)
calc '%1 %2+1' or minus if i want to go backwards, anyway any ideas? | Top |
|
Posted by
| Madrox
(40 posts) Bio
|
Date
| Reply #4 on Mon 12 Dec 2005 02:12 PM (UTC) Amended on Mon 12 Dec 2005 02:29 PM (UTC) by Madrox
|
Message
| Alright, I figured it out i think, I have a trigger matching
^Current System X\/Y\: \((.*?)\, (.*?)\)$
then I send to a script this...
Here is what I have:
dim num
num = ("%2") + 1
send "calc '%1 getvariable("num")'
and i get an error that says Expected end of statement
Line in error:
send "calc '-55 getvariable("num")'
When its all said and done I want it to send
calc '%1 NUM'
any ideas? | Top |
|
Posted by
| Shadowfyr
USA (1,790 posts) Bio
|
Date
| Reply #5 on Mon 12 Dec 2005 05:13 PM (UTC) Amended on Mon 12 Dec 2005 05:14 PM (UTC) by Shadowfyr
|
Message
| Well, you seem to be confused about how variables work here for one:
dim num
num = ("%2") + 1
creates a *script* variable. Setvariable and getvariable are used with *Mushclient* variables, which is one reason why:
send "calc '%1 getvariable("num")'
won't work. The other reason is that this is *not* correct VBScript syntax. You left off the final ", and getvarialble, even if it worked, can't happen 'inside' the send command. This would be correct:
setvariable "num", "%2"
send "calc '%1 " & getvariable("num") & "'" | Top |
|
Posted by
| Madrox
(40 posts) Bio
|
Date
| Reply #6 on Mon 12 Dec 2005 07:35 PM (UTC) Amended on Mon 12 Dec 2005 08:13 PM (UTC) by Madrox
|
Message
| Wow, im a dumb ass noob :P Well I took your trigger and just added
setvariable "num", "%2" + 1
send "calc '%1 " & getvariable("num") & "'"
and it works perfectly! thanks a bunch for your help | Top |
|
Posted by
| Madrox
(40 posts) Bio
|
Date
| Reply #7 on Tue 13 Dec 2005 02:17 AM (UTC) |
Message
| Alright, I got a script but for some reason the triggers dont work :/ any suggestions?
<?xml version="1.0" encoding="iso-8859-1" ?>
<!DOCTYPE muclient (View Source for full doctype...)>
- <!-- Saved on Monday, December 12, 2005, 7:00 PM
-->
- <!-- MuClient version 3.70
-->
- <!-- Plugin "systemsearch" generated by Plugin Wizard
-->
- <muclient>
- <plugin name="systemsearch" author="Rojan QDel" id="4e6527d4dd49421b577e993b" language="VBscript" purpose="Search for starsystems in LOTJ" save_state="y" date_written="2005-12-12 18:59:46" requires="3.65" version="1.0">
- <description trim="y">
- <![CDATA[
Made by Rojan QDel
rojanqdel@verizon.net
AIM: RojanQDel
]]>
</description>
</plugin>
- <!-- Get our standard constants
-->
<include name="constants.vbs" />
- <!-- Triggers
-->
- <triggers>
<trigger enabled="y" group="search" match="Hyperjump complete." name="search" script="completejump" sequence="100" />
</triggers>
- <!-- Aliases
-->
- <aliases>
<alias script="startsearch" match="startsearch" enabled="y" group="search" sequence="100" />
<alias script="stopsearch" match="stopsearch" enabled="y" group="search" sequence="100" />
<alias name="setfirst" script="setfirst" match="setfirst * *" enabled="y" group="search" sequence="100" />
<alias name="setsecond" script="setsecond" match="setsecond * *" enabled="y" group="search" sequence="100" />
</aliases>
- <!-- Variables
-->
- <variables>
<variable name="x1">0</variable>
<variable name="x2">0</variable>
<variable name="y1">0</variable>
<variable name="y2">0</variable>
<variable name="x1o">0</variable>
<variable name="y1o">0</variable>
</variables>
- <!-- Script
-->
- <script>
- <![CDATA[
Dim x1
Dim x1o
Dim x2
Dim y1
Dim y1o
Dim y2
Sub completejump(Thename, theoutput, thewildcards)
world.send "look"
world.send "navstat"
x1=world.getvariable ("x1")
x1o=world.getvariable ("x1o")
x2=world.getvariable ("x2")
y1=world.getvariable ("y1")
y1o=world.getvariable ("y1o")
y2=world.getvariable ("y2")
If x1 = x1o Then
Call searchy
else
Call searchx
End If
End Sub
Sub setfirst(Thename, theoutput, thewildcards)
x1o = GetAliasWildcard ("setfirst", "1")
world.setvariable "x1o", x1o
world.setvariable "x1", x1
y1o = GetAliasWildcard ("setfirst", "2")
world.setvariable "y1o", y1o
world.setvariable "y1", y1
world.note "Starting coordinates are: '" & x1o & " " & y1o & "'"
End Sub
Sub setsecond(Thename, theoutput, thewildcards)
x2 = GetAliasWildcard ("setsecond", "1")
world.setvariable "x2", x2
y2 = GetAliasWildcard ("setsecond", "2")
world.setvariable "y2", y2
world.note "Ending coordinates are: '" & x2 & " " & y2 & "'"
End Sub
Sub startsearch (Thename, theoutput, thewildcards)
world.EnableTriggerGroup "search", 1
world.note "Enabled Search Triggers!"
Call searchx
End Sub
Sub searchx ()
x1=world.getvariable ("x1")
x1o=world.getvariable ("x1o")
x2=world.getvariable ("x2")
y1=world.getvariable ("y1")
y1o=world.getvariable ("y1o")
y2=world.getvariable ("y2")
If x1 <> x2 Then
If x1 < 0 Then
x1 = x1 - 1
Else
x1 = x1 + 1
End if
world.setvariable "x1", x1
world.send "calc '" & x1 & " " & y1o & "'"
Else
x1 = x1o
world.setvariable "x1", x1
Call searchy
End If
End Sub
Sub searchy ()
x1=world.getvariable ("x1")
x1o=world.getvariable ("x1o")
x2=world.getvariable ("x2")
y1=world.getvariable ("y1")
y1o=world.getvariable ("y1o")
y2=world.getvariable ("y2")
If y1 <> y2 Then
If y1 < 0 Then
y1 = y1 - 1
Else
y1 = y1 + 1
End if
world.setvariable "y1", y1
world.send "calc '" & x1o & " " & y1 & "'"
Else
Call stopsearchs
End If
End Sub
Sub stopsearch (Thename, theoutput, thewildcards)
world.EnableTriggerGroup "search", 0
world.note "Disabled Search Triggers!"
End Sub
Sub stopsearchs ()
world.EnableTriggerGroup "search", 0
world.note "Disabled Search Triggers!"
End Sub
]]>
</script>
- <!-- Plugin help
-->
- <aliases>
<alias script="OnHelp" match="systemsearch:help" enabled="y" />
</aliases>
- <script>
- <![CDATA[
Sub OnHelp (sName, sLine, wildcards)
world.Note world.GetPluginInfo (world.GetPluginID, 3)
End Sub
]]>
</script>
</muclient> | 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.
25,052 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top