I would like users that made cool scripts or have good ideas to share over here. Here is my GPS + autosneaking + autocomming back to location where you stareted you GPS.
(It's made to polish mud so it will have polish script names and stuff) Here we go:
World.addalias "zmiana", "zmiana", "", 1025, "onprzemykaniezmiana"
'Then I putted that alias into macro with "send now" checked. It will change between sneaking and walking
sub onprzemykaniezmiana(straliasname,stroutput,arrwildcards)
if world.getvariable("przemykanie") = 0 then
world.setvariable "przemykanie", 1
world.note "Sneaking ON"
exit sub
end if
if world.getvariable("przemykanie") = 1 then
world.setvariable "przemykanie", 0
world.note "Sneaking OFF"
exit sub
end if
end sub
world.addalias "kierunek", "kierunek *", "", 1025, "onprzem"
'Then I add in keypad on KP8 "kierunek north", KP4 "kierunek west" and so on.
sub onprzem(straliasname,stroutput,arrwildcards)
dim kier
dim X
dim Y
dim Z
X = world.getvariable("X")
Y = world.getvariable("Y")
Z = world.getvariable("Z")
kier = arrwildcards (1)
if world.getvariable("przemykanie") = 1 then
world.send "sneak " & kier
else
world.send kier
end if
dim last
dim last2
last2 = world.GetMappingCount
if last2 = 0 then
world.addtomapper "health", "health"
last2 = last2 + 1
end if
last = world.GetMappingItem (last2 - 1)
if world.getvariable("GPS") = 1 then
world.setvariable "cofnij", kier
if kier = "nw" then
x=x-1
y=y+1
if last <> "se/nw" then
world.AddToMapper "nw", "se"
else world.DeleteLastMapItem
end if
end if
if kier = "n" then
y=y+1
if last <> "s/n" then
world.AddToMapper "n", "s"
else world.DeleteLastMapItem
end if
end if
if kier = "ne" then
y=y+1
x=x+1
if last <> "sw/ne" then
world.AddToMapper "ne", "sw"
else world.DeleteLastMapItem
end if
end if
if kier = "e" then
x=x+1
if last <> "w/e" then
world.AddToMapper "e", "w"
else world.DeleteLastMapItem
end if
end if
if kier = "se" then
y=y-1
x=x+1
if last <> "nw/se" then
world.AddToMapper "se", "nw"
else world.DeleteLastMapItem
end if
end if
if kier = "s" then
y=y-1
if last <> "n/s" then
world.AddToMapper "s", "n"
else world.DeleteLastMapItem
end if
end if
if kier = "sw" then
y=y-1
x=x-1
if last <> "ne/sw" then
world.AddToMapper "sw", "ne"
else world.DeleteLastMapItem
end if
end if
if kier = "w" then
x=x-1
if last <> "e/w" then
world.AddToMapper "w", "e"
else world.DeleteLastMapItem
end if
end if
if kier = "u" then
z=z+1
if last <> "d/u" then
world.AddToMapper "u", "d"
else world.DeleteLastMapItem
end if
end if
if kier = "d" then
z=z-1
if last <> "u/d" then
world.AddToMapper "d", "u"
else world.DeleteLastMapItem
end if
end if
world.setvariable "X", x
world.setvariable "Y", y
world.setvariable "Z", z
World.setstatus "GPS: [" & Cstr (world.getvariable ("X")) & "," & Cstr (world.getvariable ("Y")) & "," & Cstr (world.getvariable ("Z")) & "]"
end if
end sub
World.addalias "wroc", "wroc", "", 1025, "onwroc"
'That alias is used to come back to starting location
sub onwroc(straliasname,stroutput,arrwildcards)
world.send world.EvaluateSpeedwalk (world.ReverseSpeedwalk (world.GetMappingString))
world.DeleteAllMapItems
end sub
'That subroutine is used to cancel last move in GPS (Because you where to tired to go ther or there was no such exit)
sub oncofnij(strtriggername,stroutput,arrwildcards)
if world.getvariable("GPS") = 1 then
dim X
dim Y
dim Z
X = world.getvariable("X")
Y = world.getvariable("Y")
Z = world.getvariable("Z")
world.DeleteLastMapItem
dim kier
kier = world.getvariable("cofnij")
if kier = "nw" then
x=x+1
y=y-1
end if
if kier = "n" then
y=y-1
end if
if kier = "ne" then
y=y-1
x=x-1
end if
if kier = "e" then
x=x-1
end if
if kier = "se" then
y=y+1
x=x-1
end if
if kier = "s" then
y=y+1
end if
if kier = "sw" then
y=y+1
x=x+1
end if
if kier = "w" then
x=x+1
end if
if kier = "u" then
z=z-1
end if
if kier = "d" then
z=z+1
end if
world.setvariable "X", x
world.setvariable "Y", y
world.setvariable "Z", z
World.setstatus "GPS: [" & Cstr (world.getvariable ("X")) & "," & Cstr (world.getvariable ("Y")) & "," & Cstr (world.getvariable ("Z")) & "]"
end if
end sub
'That alias is used to set starting location
world.addalias "gpson", "gps", "", 1025, "ongpson"
sub ongpson(straliasname,stroutput,arrwildcards)
if world.getvariable("GPS") = 0 then
world.setvariable "GPS", 1
world.note "GPS - ON"
world.setvariable "X", 0
world.setvariable "Y", 0
world.setvariable "Z", 0
world.DeleteAllMapItems
'We add these trigger to cancel last move in GPS
World.addtrigger "GPS1", "*There is no such exit*", "", 1, 13, 0, "", "oncofnij"
World.addtrigger "GPS2", "*you are to tired to go there*", "", 1, 13, 0, "", "oncofnij"
exit sub
end if
if world.getvariable("GPS") = 1 then
world.setvariable "GPS", 0
world.note "GPS - off"
World.DeleteTrigger "GPS1"
World.DeleteTrigger "GPS2"
exit sub
end if
end sub
There. It works cool
___
Robert Mituniewicz |