----------------- COMMAND ----------------- FUNCTION Main(Player as LONG, Command as STRING, Parm1 as STRING, Parm2 as STRING, Parm3 as STRING) AS LONG Dim Map as String, X as String, Y as String Dim Target as LONG Dim i as LONG Main = Stop Target = Val(Parm1) If Target = 0 Then For i = 0 To GetMaxUsers() If StrCmp(Mid(Parm1, 1, Len(Parm1)), Mid(GetPlayerName(i), 1, Len(Parm1))) & IsPlaying(i) Then Target = i Next i End If If StrCmp(Parm1, "") Then Target = 0 If StrCmp(Parm1, "self") | StrCmp(Parm1, "me") | StrCmp(Parm1, "myself") Then Target = Player Select Case Command Case "GODS" RunScript1("gods", Player) Case "LADDER" RunScript1("ladder", Player) Case "TIME" RunScript1("time", Player) Case Else If GetPlayerAccess(Player) Then Select Case Command Case "GETOBJ" GiveObj(Player, Val(Parm1), Val(Parm2)) Case "DAY" MakeDay() Case "NIGHT" MakeNight() Case "STATUS" If StrCmp(Parm2, "") Then SetPlayerStatus(Player, Val(Parm1)) Else SetPlayerStatus(Target, Val(Parm2)) End If Case "SPRITE" If StrCmp(Parm2, "") Then SetPlayerSprite(Player, Val(Parm1)) Else SetPlayerSprite(Target, Val(Parm2)) End If Case "NAME" If StrCmp(Parm2, "") Then SetPlayerName(Player, Parm1) Else SetPlayerName(Target, Parm2) End If Case "WARP" If StrCmp(Mid(Parm1, 2, 1), "k") Then Parm1 = Str(Val(Parm1)*1000 + Val(Mid2(Parm1, 3))) If StrCmp(Parm2, "") Then Parm2 = "5" If StrCmp(Parm3, "") Then Parm3 = "5" If Val(Parm1) > 0 | StrCmp(Parm1, "") Then RunScript4("warp", Player, Val(Parm1), Val(Parm2), Val(Parm3)) Else RunScript4("warp", Player, GetPlayerMap(Target), 5, 5) End If Case "WHEREIS" RunScript2("whereis", Player, Target) Case "SCAN" RunScript2("scan", Player, Target) Case "MAP" RunScript1("map", Player) Case "LUM" PlayerMessage(Player, "The lowest unused map is " + Str(RunScript0("lum")) + ".", BrightGreen) Case "FREEMAPS" RunScript1("freemaps", Player) Case "LINK" RunScript0("link") Case "TREES" RunScript1("trees", Player) Case "RUN" RunScript0(Parm1) Case Else Main = Continue End Select Else Main = Continue End If End Select END FUNCTION ----------------- freemaps ------------------ SUB Main(Player as LONG) Dim i as LONG Dim Start as LONG, MapEnd as LONG Dim Message as STRING For i = 1 To 5000 If Blank(i) Then If Start = 0 Then Start = i MapEnd = i Else If Start > 0 Then If Start = MapEnd Then Message = Message + Str(Start) + " " Else Message = Message + Str(Start) + "-" + Str(MapEnd) + " " End If Start = 0 End If End If Next i If Blank(5000) Then Message = Message + Str(Start) + "-" + Str(MapEnd) + " " PlayerMessage(Player, "Free Maps: " + Message, Green) END SUB FUNCTION Blank(Map as LONG) as LONG Dim X as LONG, Y as LONG Dim i as LONG Blank = 1 ' If If (!StrCmp(GetMapName(Map), "") Then Goto FuncEnd For i = 0 To 3 If GetMapExit(Map, i) <> 0 Then Goto FuncEnd Next i For X = 0 To 11 For Y = 0 To 11 For i = 0 To 5 If GetTileSprite(Map, X, Y, i) <> 0 Then Goto FuncEnd Next i If GetTileAtt(Map, X, Y) <> 0 Then Goto FuncEnd If GetTileAtt2(Map, X, Y) <> 0 Then Goto FuncEnd Next Y Next X Exit Sub FuncEnd: Blank = 0 END FUNCTION ----------------- gods ----------------- Sub Main(Player as Long) Dim i as Long For i = 0 To 75 If IsPlaying(i) & GetPlayerAccess(i) > 0 Then PlayerMessage(Player, GetPlayerName(i) + " Access: " + Str(GetPlayerAccess(i)), BrightCyan) Next i End Sub ----------------- grid ----------------- Type Stack Dim Data(200) as LONG Dim Size as LONG SUB Push(s as LONG) Data(Size) = s Size = Size + 1 END SUB FUNCTION Pop() as LONG Size = Size - 1 Pop = Data(Size) END FUNCTION FUNCTION PeekTop() as LONG PeekTop = Data(Size-1) END FUNCTION FUNCTION isEmpty() as LONG isEmpty = Size = 0 END FUNCTION FUNCTION isFull() as LONG isFull = Size = 200 END FUNCTION End Type Type BinarySearchArray Dim Data(200) as LONG Dim Size as LONG SUB Add(s as LONG) Dim i as LONG While Data(i) = 0 & i < 200 i = i + 1 Wend While Data(i) < s & i < 200 Data(i-1) = Data(i) i = i + 1 Wend If i > 0 Then i = i - 1 Data(i) = s END SUB FUNCTION Find(s as LONG) as LONG Dim x as LONG Dim l as LONG, r as LONG l = 0 r = 199 While r >= l x = (l + r) / 2 If Data(x)/10000 = s/10000 Then Find = x If Data(x) < s Then l = x + 1 Else r = x - 1 End If Wend END FUNCTION FUNCTION isEmpty() as LONG isEmpty = Size = 0 END FUNCTION FUNCTION isFull() as LONG isFull = Size = 200 END FUNCTION End Type Dim Visited as BinarySearchArray SUB Link(Map as LONG) Dim Cur as LONG, i as LONG Dim MapStack as Stack MapStack.Push(Map * 10000 + 5050) Visited.Add(Map * 10000 + 5050) While (!MapStack.isEmpty()) Cur = MapStack.Pop() For i = 0 To 3 If GetMapExit(Cur/10000, i) > 0 & Visited.Find(GetMapExit(Cur/10000, i)*10000) = 0 Then Select Case i Case 0 MapStack.Push(GetMapExit(Cur/10000, i)*10000 + Cur%10000 - 1) Visited.Add(GetMapExit(Cur/10000, i)*10000 + Cur%10000 - 1) Case 1 MapStack.Push(GetMapExit(Cur/10000, i)*10000 + Cur%10000 + 1) Visited.Add(GetMapExit(Cur/10000, i)*10000 + Cur%10000 + 1) Case 2 MapStack.Push(GetMapExit(Cur/10000, i)*10000 + Cur%10000 - 100) Visited.Add(GetMapExit(Cur/10000, i)*10000 + Cur%10000 - 100) Case 3 MapStack.Push(GetMapExit(Cur/10000, i)*10000 + Cur%10000 + 100) Visited.Add(GetMapExit(Cur/10000, i)*10000 + Cur%10000 + 100) End Select End If Next i Wend END SUB SUB Main(Player as LONG) Dim Maps as BinarySearchArray Dim MinX as LONG Dim i as LONG, j as LONG, k as LONG Dim Message as STRING, Message2 as STRING Link(GetPlayerMap(Player)) MinX = 50 i = 199 While Visited.Data(i) > 0 & i >= 0 Maps.Add(Visited.Data(i)%100*1000000 + Visited.Data(i)%10000/100*10000 + Visited.Data(i)/10000) If Visited.Data(i)%10000/100 < MinX Then MinX = Visited.Data(i)%10000/100 i = i - 1 Wend i = 0 While Maps.Data(i) = 0 & i < 200 i = i + 1 Wend PlayerMessage(Player, "------===Maps in this link===------", Yellow) k = MinX For j = i To 199 While k <= Maps.Data(j)%1000000/10000 Message = Message + " " Message2 = Message2 + " " k = k + 1 Wend Message = Message + Center(Str(Maps.Data(j)%10000), 10) If GetMapExit(Maps.Data(j)%10000, 0) = 0 Then If GetMapExit(Maps.Data(j)%10000, 1) = 0 Then If GetMapExit(Maps.Data(j)%10000, 2) = 0 Then If GetMapExit(Maps.Data(j)%10000, 3) = 0 Then Message2 = Message2 + "  " '7 Else Message2 = Message2 + " " '6 End If Else If GetMapExit(Maps.Data(j)%10000, 3) = 0 Then Message2 = Message2 + " " '6 Else Message2 = Message2 + "" '6 End If End If Else If GetMapExit(Maps.Data(j)%10000, 2) = 0 Then If GetMapExit(Maps.Data(j)%10000, 3) = 0 Then Message2 = Message2 + "  " '5 Else Message2 = Message2 + " " '1 End If Else If GetMapExit(Maps.Data(j)%10000, 3) = 0 Then Message2 = Message2 + " " '2 Else Message2 = Message2 + "" '22 End If End If End If Else If GetMapExit(Maps.Data(j)%10000, 1) = 0 Then If GetMapExit(Maps.Data(j)%10000, 2) = 0 Then If GetMapExit(Maps.Data(j)%10000, 3) = 0 Then Message2 = Message2 + "  " '5 Else Message2 = Message2 + " " '3 End If Else If GetMapExit(Maps.Data(j)%10000, 3) = 0 Then Message2 = Message2 + " " '4 Else Message2 = Message2 + "" '21 End If End If Else If GetMapExit(Maps.Data(j)%10000, 2) = 0 Then If GetMapExit(Maps.Data(j)%10000, 3) = 0 Then Message2 = Message2 + "  " '5 Else Message2 = Message2 + " " '25 End If Else If GetMapExit(Maps.Data(j)%10000, 3) = 0 Then Message2 = Message2 + " " '23 Else Message2 = Message2 + "" '16 End If End If End If End If k = k + 1 If Maps.Data(j)/1000000 <> Maps.Data(j+1)/1000000 Then PlayerMessage(Player, Message, BrightGreen) PlayerMessage(Player, Message2, BrightGreen) Message = "" Message2 = "" k = MinX End If Next j PlayerMessage(Player, Message, BrightGreen) PlayerMessage(Player, Message2, BrightGreen) END SUB FUNCTION Center(Message as STRING, Width as LONG) as STRING Dim MessageWidth as LONG, i as LONG Dim Spaces as STRING MessageWidth = StrWidth(Message) MessageWidth = MessageWidth / 4 + MessageWidth % 4 / 2 For i = 1 To (Width - MessageWidth)/2 Spaces = Spaces + " " Next i If MessageWidth % 2 = 0 Then Message = Spaces + Message Else Message = Spaces + " " + Message End If Center = Message + Spaces END FUNCTION FUNCTION StrWidth(Message as STRING) as LONG Dim i as LONG For i = 1 To Len(Message) StrWidth = StrWidth + CharWidth(Mid(Message, i, 1)) Next i If StrCmp(Message, "") Then StrWidth = 0 END FUNCTION FUNCTION CharWidth(Char as STRING) as LONG Select Case Char Case " " CharWidth = 4 Case Else CharWidth = 8 End Select END FUNCTION ----------------- JOINGAME ------------------ SUB Main(Player AS LONG) Dim User as String, IP as String, Name as String Dim i as Long User = GetPlayerUser(Player) IP = GetPlayerIP(Player) Name = GetPlayerName(Player) i = 1 While ReadIniStr("playernames", User, "Name"+Str(i), "") <> "" If StrCmp(ReadIniStr("playernames", User, "Name"+Str(i), ""), Name) & StrCmp(ReadIniStr("playernames", User, "IP"+Str(i), ""), IP) Then Exit Sub i = i + 1 Wend WriteIniStr("playernames", User, "Name"+Str(i), Name) WriteIniStr("playernames", User, "IP"+Str(i), IP) i = 1 While ReadIniStr("playerips", IP, "Name"+Str(i), "") <> "" i = i + 1 Wend WriteIniStr("playerips", IP, "Name"+Str(i), Name) WriteIniStr("playerips", IP, "User"+Str(i), User) END SUB ----------------- ladder ----------------- SUB Main(Player as LONG) Dim Players(50) as LONG, N as LONG Dim i as LONG, j as LONG Dim Slot as LONG N = 50 j = 0 For i = 1 To N If IsPlaying(i) & GetPlayerAccess(i) = 0 Then Players(j) = i j = j + 1 End If Next i For i = 1 To N-1 j = i Slot = Players(i) While j > 0 & (GetPlayerLevel(Players(j-1)) < GetPlayerLevel(Slot) | (GetPlayerLevel(Players(j-1)) = GetPlayerLevel(Slot) & GetPlayerExperience(Players(j-1)) < GetPlayerExperience(Slot))) Players(j) = Players(j-1) j = j - 1 Wend Players(j) = Slot Next i PlayerMessage(Player, "Online Level Ladder:", BrightCyan) For i = 0 To 9 If Players(i) > 0 Then PlayerMessage(Player, "#" + AlignNum(i+1) + " - " + GetPlayerName(Players(i)) + " Level: " + Str(GetPlayerLevel(Players(i))) + " Experience: " + Str(GetPlayerExperience(Players(i))), BrightBlue) Next i END SUB Function AlignNum(Number as Long) as String If Number < 10 Then AlignNum = " " + Str(Number) Else AlignNum = Str(Number) End If End Function ----------------- link ----------------- Type Stack Dim Data(200) as LONG Dim Size as LONG SUB Push(s as LONG) Data(Size) = s Size = Size + 1 END SUB FUNCTION Pop() as LONG Size = Size - 1 Pop = Data(Size) END FUNCTION FUNCTION PeekTop() as LONG PeekTop = Data(Size-1) END FUNCTION FUNCTION isEmpty() as LONG isEmpty = Size = 0 END FUNCTION FUNCTION isFull() as LONG isFull = Size = 200 END FUNCTION End Type Type BinarySearchArray Dim Data(200) as LONG Dim Size as LONG SUB Add(s as LONG) Dim i as LONG While Data(i) = 0 & i < 200 i = i + 1 Wend While Data(i) < s & i < 200 Data(i-1) = Data(i) i = i + 1 Wend If i > 0 Then i = i - 1 Data(i) = s END SUB FUNCTION Find(s as LONG) as LONG Dim x as LONG Dim l as LONG, r as LONG l = 0 r = 199 While r >= l x = (l + r) / 2 If Data(x)/10000 = s/10000 Then Find = x If Data(x) < s Then l = x + 1 Else r = x - 1 End If Wend END FUNCTION FUNCTION isEmpty() as LONG isEmpty = Size = 0 END FUNCTION FUNCTION isFull() as LONG isFull = Size = 200 END FUNCTION End Type Dim Visited as BinarySearchArray SUB Link(Map as LONG) Dim Cur as LONG, i as LONG Dim MapStack as Stack MapStack.Push(Map * 10000 + 5050) Visited.Add(Map * 10000 + 5050) While (!MapStack.isEmpty()) Cur = MapStack.Pop() If Cur%100 = 50 Then Select Case Cur%10000/100 Case 49 SetMapExit(Cur/10000, 3, Map) SetMapExit(Map, 2, Cur/10000) UpdateMap(Cur/10000) Case 51 SetMapExit(Cur/10000, 2, Map) SetMapExit(Map, 3, Cur/10000) UpdateMap(Cur/10000) End Select End If If Cur%10000/100 = 50 Then Select Case Cur%100 Case 49 SetMapExit(Cur/10000, 1, Map) SetMapExit(Map, 0, Cur/10000) UpdateMap(Cur/10000) Case 51 SetMapExit(Cur/10000, 0, Map) SetMapExit(Map, 1, Cur/10000) UpdateMap(Cur/10000) End Select End If For i = 0 To 3 If GetMapExit(Cur/10000, i) > 0 & Visited.Find(GetMapExit(Cur/10000, i)*10000) = 0 Then Select Case i Case 0 MapStack.Push(GetMapExit(Cur/10000, i)*10000 + Cur%10000 - 1) Visited.Add(GetMapExit(Cur/10000, i)*10000 + Cur%10000 - 1) Case 1 MapStack.Push(GetMapExit(Cur/10000, i)*10000 + Cur%10000 + 1) Visited.Add(GetMapExit(Cur/10000, i)*10000 + Cur%10000 + 1) Case 2 MapStack.Push(GetMapExit(Cur/10000, i)*10000 + Cur%10000 - 100) Visited.Add(GetMapExit(Cur/10000, i)*10000 + Cur%10000 - 100) Case 3 MapStack.Push(GetMapExit(Cur/10000, i)*10000 + Cur%10000 + 100) Visited.Add(GetMapExit(Cur/10000, i)*10000 + Cur%10000 + 100) End Select End If Next i Wend END SUB SUB Edge(Map as LONG) Dim i as LONG, j as LONG Dim Exits(4) as LONG For i = 0 To 3 Exits(i) = GetMapExit(Map, i) Next i For i = 0 To 11 If Exits(0) > 0 Then For j = 0 To 5 SetTileSprite(Map, i, 0, j, GetTileSprite(Exits(0), i, 11, j)) Next j End If If Exits(1) > 0 Then For j = 0 To 5 SetTileSprite(Map, i, 11, j, GetTileSprite(Exits(1), i, 0, j)) Next j End If If Exits(2) > 0 Then For j = 0 To 5 SetTileSprite(Map, 0, i, j, GetTileSprite(Exits(2), 11, i, j)) Next j End If If Exits(3) > 0 Then For j = 0 To 5 SetTileSprite(Map, 11, i, j, GetTileSprite(Exits(3), 0, i, j)) Next j End If Next i END SUB SUB Main(Player as LONG, Command as STRING, Parm1 as STRING, Parm2 as STRING, Parm3 as STRING) Dim Direction as LONG, Map as LONG Select Case Parm1 Case "UP" Direction = 0 Case "U" Direction = 0 Case "NORTH" Direction = 0 Case "N" Direction = 0 Case "0" Direction = 0 Case "DOWN" Direction = 1 Case "D" Direction = 1 Case "SOUTH" Direction = 1 Case "S" Direction = 1 Case "1" Direction = 1 Case "LEFT" Direction = 2 Case "L" Direction = 2 Case "WEST" Direction = 2 Case "W" Direction = 2 Case "2" Direction = 2 Case "RIGHT" Direction = 3 Case "R" Direction = 3 Case "EAST" Direction = 3 Case "E" Direction = 3 Case "3" Direction = 3 Case Else PlayerMessage(Player, "Please specify a direction.", Yellow) Exit Sub End Select Map = Val(Parm2) If Map = 0 Then Map = RunScript0("lum") UpdateMap(GetPlayerMap(Player)) UpdateMap(Map) SetMapExit(GetPlayerMap(Player), Direction, Map) SetMapExit(Map, Direction+1-Direction%2*2, GetPlayerMap(Player)) Link(Map) Edge(Map) UpdateMap(GetPlayerMap(Player)) UpdateMap(Map) PlayerMessage(Player, "Map " + Str(Map) + " linked.", BrightGreen) END SUB FUNCTION Center(Message as STRING, Width as LONG) as STRING Dim MessageWidth as LONG, i as LONG Dim Spaces as STRING MessageWidth = StrWidth(Message) MessageWidth = MessageWidth / 4 + MessageWidth % 4 / 2 For i = 1 To (Width - MessageWidth)/2 Spaces = Spaces + " " Next i If MessageWidth % 2 = 0 Then Message = Spaces + Message Else Message = Spaces + " " + Message End If Center = Message + Spaces END FUNCTION FUNCTION StrWidth(Message as STRING) as LONG Dim i as LONG For i = 1 To Len(Message) StrWidth = StrWidth + CharWidth(Mid(Message, i, 1)) Next i If StrCmp(Message, "") Then StrWidth = 0 END FUNCTION FUNCTION CharWidth(Char as STRING) as LONG Select Case Char Case " " CharWidth = 4 Case Else CharWidth = 8 End Select END FUNCTION ----------------- lum ----------------- FUNCTION Main() as LONG Dim Map as LONG Map = 1 While Blank(Map) = 0 Map = Map + 1 Wend Main = Map END FUNCTION FUNCTION Blank(Map as LONG) as LONG Dim X as LONG, Y as LONG Dim i as LONG Blank = 1 If (!StrCmp(GetMapName(Map), "")) Then Blank = 0 For i = 0 To 3 If GetMapExit(Map, i) <> 0 Then Blank = 0 Next i For X = 0 To 11 For Y = 0 To 11 For i = 0 To 5 If GetTileSprite(Map, X, Y, i) <> 0 Then Blank = 0 Next i If GetTileAtt(Map, X, Y) <> 0 Then Blank = 0 If GetTileAtt2(Map, X, Y) <> 0 Then Blank = 0 Next Y Next X END FUNCTION ----------------- map ----------------- Type Stack Dim Data(200) as LONG Dim Size as LONG SUB Push(s as LONG) Data(Size) = s Size = Size + 1 END SUB FUNCTION Pop() as LONG Size = Size - 1 Pop = Data(Size) END FUNCTION FUNCTION PeekTop() as LONG PeekTop = Data(Size-1) END FUNCTION FUNCTION isEmpty() as LONG isEmpty = Size = 0 END FUNCTION FUNCTION isFull() as LONG isFull = Size = 200 END FUNCTION End Type Type BinarySearchArray Dim Data(200) as LONG Dim Size as LONG SUB Add(s as LONG) Dim i as LONG While Data(i) = 0 & i < 200 i = i + 1 Wend While Data(i) < s & i < 200 Data(i-1) = Data(i) i = i + 1 Wend If i > 0 Then i = i - 1 Data(i) = s END SUB FUNCTION Find(s as LONG) as LONG Dim x as LONG Dim l as LONG, r as LONG l = 0 r = 199 While r >= l x = (l + r) / 2 If Data(x)/10000 = s/10000 Then Find = x If Data(x) < s Then l = x + 1 Else r = x - 1 End If Wend END FUNCTION FUNCTION isEmpty() as LONG isEmpty = Size = 0 END FUNCTION FUNCTION isFull() as LONG isFull = Size = 200 END FUNCTION End Type Dim Visited as BinarySearchArray SUB Link(Map as LONG) Dim Cur as LONG, i as LONG Dim MapStack as Stack MapStack.Push(Map * 10000 + 5050) Visited.Add(Map * 10000 + 5050) While (!MapStack.isEmpty()) Cur = MapStack.Pop() For i = 0 To 3 If GetMapExit(Cur/10000, i) > 0 & Visited.Find(GetMapExit(Cur/10000, i)*10000) = 0 Then Select Case i Case 0 MapStack.Push(GetMapExit(Cur/10000, i)*10000 + Cur%10000 - 1) Visited.Add(GetMapExit(Cur/10000, i)*10000 + Cur%10000 - 1) Case 1 MapStack.Push(GetMapExit(Cur/10000, i)*10000 + Cur%10000 + 1) Visited.Add(GetMapExit(Cur/10000, i)*10000 + Cur%10000 + 1) Case 2 MapStack.Push(GetMapExit(Cur/10000, i)*10000 + Cur%10000 - 100) Visited.Add(GetMapExit(Cur/10000, i)*10000 + Cur%10000 - 100) Case 3 MapStack.Push(GetMapExit(Cur/10000, i)*10000 + Cur%10000 + 100) Visited.Add(GetMapExit(Cur/10000, i)*10000 + Cur%10000 + 100) End Select End If Next i Wend END SUB SUB Main(Player as LONG) Dim Map as Long Dim Maps as BinarySearchArray Dim MinX as LONG Dim i as LONG, j as LONG, k as LONG Dim Message as STRING Link(GetPlayerMap(Player)) MinX = 50 i = 199 While Visited.Data(i) > 0 & i >= 0 Maps.Add(Visited.Data(i)%100*1000000 + Visited.Data(i)%10000/100*10000 + Visited.Data(i)/10000) If Visited.Data(i)%10000/100 < MinX Then MinX = Visited.Data(i)%10000/100 i = i - 1 Wend i = 0 While Maps.Data(i) = 0 & i < 200 i = i + 1 Wend PlayerMessage(Player, "------===Maps in this link===------", Yellow) k = MinX For j = i To 199 While k <= Maps.Data(j)%1000000/10000 Message = Message + " " k = k + 1 Wend Message = Message + SpaceBuffer(Maps.Data(j)%10000) k = k + 1 If Maps.Data(j)/1000000 <> Maps.Data(j+1)/1000000 Then PlayerMessage(Player, Message, BrightGreen) Message = "" k = MinX End If Next j PlayerMessage(Player, Message, BrightGreen) END SUB Function SpaceBuffer(Number as Long) as String If Number < 10 Then SpaceBuffer = " " + Str(Number) + " " Else If Number < 100 Then SpaceBuffer = " " + Str(Number) + " " Else If Number < 1000 Then SpaceBuffer = " " + Str(Number) + " " Else SpaceBuffer = " " + Str(Number) + " " End If End If End If End Function ----------------- pengwy ----------------- Sub Main(Player as Long) End Sub '-=-=-=-=-=-=-=-=-=-=- Script by Pengwy -=-=-=-=-=-=-=-=-=-=-' ' ' ' ||||++.. ' ' 0C++%uZ) ' ' 0! ..0! uSACFZu~ 0ZuZOOl: uCZZCu0! 0!.:J0:..0I Z!: .:Z) ' ' 0HSSFZu~ 03: ..0! 0Zu...0I 0u..+u0! H!:u4Hu):H( )!5 |S): ' ' 0! 0HCCCCC+ 0! 0! 0! ..0! Sl|@l:@5)S| .I@+3@.. ' ' 0! 0HCCCCC+ 0! 0! 0! ..0! Sl|@l:@5)S| .I@+3@.. ' ' 0! 0J: .:T~ 0! 0! 0J::!Z0! u5F4) OOFu~ ~u@SI ' ' C+ :%CCJT-. C+ C+ :%CC%:0! ~IC:. ~IC~- .:0!. ' ' 5(: .:0! :%5+ ' ' :%JCCC:. C3!.. ' ' ' '-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-' ----------------- scan ----------------- SUB Main(Player as LONG, Target as LONG) Dim PNum as LONG If Target = 0 Then PlayerMessage(Player, " ", 0) For PNum = 1 To GetMaxUsers() If IsPlaying(PNum) & GetPlayerMap(PNum) = GetPlayerMap(Player) & PNum <> Player Then Message(Player, PNum) Next PNum Else Message(Player, Target) End If END SUB SUB Message(Player as LONG, Target as LONG) Dim ItemNum AS LONG Dim FirstItem AS LONG Dim InventoryList AS STRING PlayerMessage(Player, Str(Target)+" - "+GetPlayerName(Target)+" is a level "+Str(GetPlayerLevel(Target))+" "+GetClassName(GetPlayerClass(Target))+" with "+Str(GetPlayerMaxHP(Target))+" HP, "+Str(GetPlayerMaxEnergy(Target))+" energy, "+Str(GetPlayerMaxMana(Target))+" mana, "+Str(GetPlayerStrength(Target))+" str, "+Str(GetPlayerAgility(Target))+" agi, "+Str(GetPlayerEndurance(Target))+" end, and "+Str(GetPlayerIntelligence(Target))+" int.", BrightBlue) FirstItem = 0 For ItemNum = 1 To 30 If (GetPlayerInvObject(Target, ItemNum) > 0 & FirstItem = 0) Then FirstItem = ItemNum Next ItemNum InventoryList = Str(Target)+" - "+GetPlayerName(Target)+" has the following inventory items: "+Str(GetPlayerInvObject(Target, FirstItem))+"-"+GetObjectName(GetPlayerInvObject(Target, FirstItem)) If GetObjectType(GetPlayerInvObject(Target, FirstItem)) = 6 Then InventoryList = InventoryList+"["+Str(GetPlayerInvValue(Target, FirstItem))+"]" For ItemNum = FirstItem+1 To 30 If GetPlayerInvObject(Target, ItemNum) > 0 Then InventoryList = InventoryList+", "+Str(GetPlayerInvObject(Target, ItemNum))+"-"+GetObjectName(GetPlayerInvObject(Target, ItemNum)) If GetObjectType(GetPlayerInvObject(Target, ItemNum)) = 6 Then InventoryList = InventoryList+"["+Str(GetPlayerInvValue(Target, ItemNum))+"]" Next ItemNum If FirstItem = 0 Then InventoryList = Str(Target)+" - "+GetPlayerName(Target)+"'s inventory is empty" PlayerMessage(Player, InventoryList+".", White) END SUB ----------------- time ----------------- Sub Main(Player as Long) Dim Realtime as Time Realtime.Get() MessageTime(Player, Realtime, BrightGreen) End Sub Sub MessageTime(Player as Long, t as Time, Color as Long) Dim Message as String Message = "The server date and time is - " + Days(t) + "day, " Message = Message + Months(t) + " " + Str(t.Date) + ", " + "2005" Message = Message + " at " + Hours(t) + ":" + Minutes(t) + " " + APM(t) + "." PlayerMessage(Player, Message, Color) End Sub Function Days(t as Time) as String Select Case t.WeekDay Case 0 Days = "Sun" Case 1 Days = "Mon" Case 2 Days = "Tues" Case 3 Days = "Wednes" Case 4 Days = "Thurs" Case 5 Days = "Fri" Case 6 Days = "Satur" End Select End Function Function Months(t as Time) as String Select Case t.Month Case 1 Months = "January" Case 2 Months = "February" Case 3 Months = "March" Case 4 Months = "April" Case 5 Months = "May" Case 6 Months = "June" Case 7 Months = "July" Case 8 Months = "August" Case 9 Months = "September" Case 10 Months = "October" Case 11 Months = "November" Case 12 Months = "December" End Select End Function Function Hours(t as Time) as String Hours = Str((t.Hour-1)%12+1) End Function Function Minutes(t as Time) as String If t.Minute < 10 Then Minutes = "0" Minutes = Minutes + Str(t.Minute) End Function Function APM(t as Time) as String If t.Hour < 12 Then APM = "AM" Else APM = "PM" End If End Function ----------------- trees ----------------- SUB Main(Player as LONG) Dim Map as LONG, x as LONG, y as LONG, Sprite as Long Map = GetPlayerMap(Player) For x = 0 To 11 For y = 0 To 11 Sprite = GetTileSprite(Map, x, y, 2) If Sprite > 10301 & Sprite < 10347 Then SetTileSprite(Map, x, y-1, 4, Sprite-7) SetTileAtt(Map, x, y, 1, 0, 0, 0, 0) End If Next y Next x UpdateMap(Map) END SUB ----------------- trees2 ----------------- SUB Main(Player as LONG) Dim Map as LONG, x as LONG, y as LONG Dim Sprite(12, 12) as LONG Dim a as LONG, b as LONG, c as LONG, d as LONG Map = GetPlayerMap(Player) For x = 0 To 11 For y = 0 To 11 Sprite(x, y) = GetTileSprite(Map, x, y, 2) Next y Next x For x = 0 To 11 For y = 0 To 11 If GetTileAtt(Map, x, y) = 16 Then SetTileAtt(Map, x, y, 0, 0, 0, 0, 0) If GetTileAtt2(Map, x, y) = 16 Then SetTileAtt2(Map, x, y, 0, 0, 0, 0, 0) If Sprite(x, y) > 10301 & Sprite(x, y) < 10347 Then SetTileSprite(Map, x, y-1, 4, Sprite(x, y)-7) a = Random(16) b = Random(12) c = Random(4) If x = 0 Then c = Random(2)*2 If x = 11 Then c = Random(2)*2+1 If y <= 1 Then c = Random(2) If y = 0 Then b = 0 If y = 11 Then c = Random(2)+2 SetTileAtt(Map, x, y, 16, 4, a, b, c) SetTileAtt2(Map, x, y-1, 16, 16, a, b, c) Else a = 0 b = 0 c = 0 d = 0 If Sprite(x, y-1) > 10301 & Sprite(x, y-1) < 10347 Then a = 3 If Sprite(x, y+1) > 10301 & Sprite(x, y+1) < 10347 Then b = 3 If Sprite(x-1, y) > 10301 & Sprite(x-1, y) < 10347 Then c = 3 If Sprite(x+1, y) > 10301 & Sprite(x+1, y) < 10347 Then d = 3 If y = 0 Then a = 0 If y = 11 Then b = 0 If x = 0 Then c = 0 If x = 11 Then d = 0 If a > 0 | b > 0 | c > 0 | d > 0 Then SetTileAtt(Map, x, y, 13, a, b, c, d) End If Next y Next x For x = 0 To 11 If Sprite(x, y) > 10301 & Sprite(x, y) < 10347 Then a = Random(16) c = Random(2) SetTileAtt2(Map, x, 11, 16, 16, a, 0, c) End If Next x UpdateMap(Map) END SUB ----------------- warp ----------------- SUB Main(Player as LONG, Map as LONG, X as LONG, Y as LONG) If Map < 1 | Map > 5000 Then Map = 1 If X < 0 | X > 11 Then X = 5 If Y < 0 | Y > 11 Then Y = 5 PlayerWarp(Player, Map, X, Y) END SUB ----------------- whereis ----------------- SUB Main(Player as LONG, Target as LONG) Dim PNum as LONG If Target = 0 Then PlayerMessage(Player, " ", 0) For PNum = 1 To GetMaxUsers() If IsPlaying(PNum) Then Message(Player, PNum) Next PNum Else Message(Player, Target) End If END SUB SUB Message(Player as LONG, Target as LONG) PlayerMessage(Player, Str(Target)+" - "+GetPlayerIP(Target)+" - "+GetPlayerUser(Target)+" - "+GetPlayerName(Target)+" is at ["+Str(GetPlayerMap(Target))+", "+Str(GetPlayerX(Target))+", "+Str(GetPlayerY(Target))+"], ''"+GetMapName(GetPlayerMap(Target))+"''", Yellow) END SUB