
LctX undefined
Handlers
0: construct(me)
Lingo Code

on construct(me)
  pInfoConnID = getVariable("connection.info.id")
  pRoomConnID = getVariable("connection.room.id")
  pRoomId = ""
  pActiveFlag = 0
  pProcessList = []
  pSaveData = void()
  pCacheKey = ""
  pCacheFlag = getVariableValue("room.map.cache", 0)
  pTrgDoorID = void()
  pPickedCryName = ""
  pUserObjList = []
  pActiveObjList = []
  pPassiveObjList = []
  pItemObjList = []
  pFlatRatings = [#rate:-1, #Percent:0]
  pBalloonId = "Chat Manager"
  pClassContId = "Room Classes"
  pRoomPrgID = "Room Program"
  pRoomPollerID = "Room Poller"
  pAdSystemID = "Room ad"
  pInterstitialSystemID = "Interstitial system"
  pSpectatorSystemID = "Room Mode Manager"
  pFurniChooserID = "Furniture Chooser"
  pShadowManagerID = "Room Shadow Manager"
  pGroupInfoID = "Group_Info"
  pRoomEventBrowserID = "RoomEvent Browser Window"
  pRoomEventList = []
  pChatProps = []
  pChatProps.setAt("returnCount", 0)
  pChatProps.setAt("timerStart", 0)
  pChatProps.setAt("timerDelay", 0)
  pChatProps.setAt("mode", "CHAT")
  pChatProps.setAt("hobbaCmds", getVariableValue("moderator.cmds"))
  createObject(pClassContId, getClassVariable("variable.manager.class"))
  getObject(pClassContId).dump("fuse.object.classes", "\r")
  createObject(pBalloonId, "Chat Manager")
  createObject(pAdSystemID, "Ad Manager")
  pCastLoaded = 0
  pPrvRoomsReady = 0
  createObject(pInterstitialSystemID, "Interstitial Manager")
  createObject(pSpectatorSystemID, "Spectator System Class")
  pCurrentSlidingObjects = []
  createObject(pShadowManagerID, "Shadow Manager")
  createObject(pGroupInfoID, "Group Info Class")
  pOneWayDoorManagerID = "One Way Door Manager"
  createObject(pOneWayDoorManagerID, "OneWayDoor Manager Class")
  registerMessage(#pickAndGoCFH, me.getID(), #pickAndGoCFH)
  registerMessage(#enterRoom, me.getID(), #enterRoom)
  registerMessage(#leaveRoom, me.getID(), #leaveRoom)
  registerMessage(#changeRoom, me.getID(), #leaveRoom)
  registerMessage(#enterRoomDirect, me.getID(), #enterRoomDirect)
  registerMessage(#setEnterRoomAlert, me.getID(), #setEnterRoomAlert)
  registerMessage(#removeEnterRoomAlert, me.getID(), #removeEnterRoomAlert)
  registerMessage(#show_hide_roomevents, me.getID(), #showHideRoomevents)
  pEnterDoorData = void()
  pEnterDoorLocked = 0
  return(1)
  exit
end

1: deconstruct(me)
Lingo Code

on deconstruct(me)
  removeUpdate(me.getID())
  unregisterMessage(#enterRoom, me.getID())
  unregisterMessage(#leaveRoom, me.getID())
  unregisterMessage(#changeRoom, me.getID())
  unregisterMessage(#enterRoomDirect, me.getID())
  unregisterMessage(#show_hide_roomevents, me.getID())
  removeConnection(pRoomConnID)
  if listp(pUserObjList) then
    call(#deconstruct, pUserObjList)
  end if
  if listp(pActiveObjList) then
    call(#deconstruct, pActiveObjList)
  end if
  if listp(pPassiveObjList) then
    call(#deconstruct, pPassiveObjList)
  end if
  if listp(pItemObjList) then
    call(#deconstruct, pItemObjList)
  end if
  if objectExists(pBalloonId) then
    removeObject(pBalloonId)
  end if
  if objectExists(pClassContId) then
    removeObject(pClassContId)
  end if
  if objectExists(pRoomPrgID) then
    removeObject(pRoomPrgID)
  end if
  if objectExists(pAdSystemID) then
    removeObject(pAdSystemID)
  end if
  if objectExists(pInterstitialSystemID) then
    removeObject(pInterstitialSystemID)
  end if
  if objectExists(pSpectatorSystemID) then
    removeObject(pSpectatorSystemID)
  end if
  if objectExists(pShadowManagerID) then
    removeObject(pShadowManagerID)
  end if
  if objectExists(pGroupInfoID) then
    removeObject(pGroupInfoID)
  end if
  if objectExists(pOneWayDoorManagerID) then
    removeObject(pOneWayDoorManagerID)
  end if
  pRoomId = ""
  pUserObjList = []
  pActiveObjList = []
  pPassiveObjList = []
  pItemObjList = []
  pCurrentSlidingObjects = []
  pEnterRoomAlert = ""
  return(1)
  exit
end

2: prepare(me)
Lingo Code

on prepare(me)
  if pActiveFlag then
    pEnterDoorLocked = 1
    call(#update, pUserObjList)
    me.updateSlideObjects(the milliSeconds)
    call(#update, pActiveObjList)
    call(#update, pItemObjList)
    pEnterDoorLocked = 0
    if not voidp(pEnterDoorData) then
      me.enterDoor(pEnterDoorData)
      pEnterDoorData = void()
    end if
  end if
  exit
end

3: enterRoom(me, tRoomDataStruct)
Lingo Code

on enterRoom(me,tRoomDataStruct)
  tStamp = ""
  tNo = 1
  repeat while tNo <= 100
    tChar = numToChar(random(48) + 74)
    tStamp = tStamp & tChar
    tNo = 1 + tNo
  end repeat
  tFuseReceipt = getSpecialServices().getReceipt(tStamp)
  tReceipt = []
  tCharNo = 1
  repeat while tCharNo <= tStamp.length
    tChar = chars(tStamp, tCharNo, tCharNo)
    tChar = charToNum(tChar)
    tReceipt.setAt(tCharNo, tChar)
    tCharNo = 1 + tCharNo
  end repeat
  if tReceipt <> tFuseReceipt then
    error(me, "Invalid build structure", #enterRoom, #critical)
    createTimeout(#builddisconnect, 3000, #disconnect, getThread(#login).getComponent().getID(), void(), 1)
  end if
  if not listp(tRoomDataStruct) then
    error(me, "Invalid room data struct!", #enterRoom, #major)
    return(executeMessage(#leaveRoom))
  end if
  getInterstitial().adRequested()
  me.getRoomConnection().send("GETINTERST", "general")
  tdata = tRoomDataStruct.duplicate()
  if voidp(tdata.getAt(#id)) then
    error(me, "Missing ID in room data struct!", #enterRoom, #major)
    return(executeMessage(#leaveRoom))
  end if
  if pRoomId <> "" then
    executeMessage(#changeRoom)
  end if
  tSession = getObject(#session)
  tSession.set("room_owner", 0)
  tSession.set("room_controller", 0)
  if tdata.getAt(#type) = #private then
    pRoomId = "private"
  else
    pRoomId = tdata.getAt(#id)
  end if
  pTrgDoorID = void()
  pSaveData = tdata
  pCastLoaded = 0
  me.loadRoomCasts()
  return(1)
  exit
end

4: enterDoor(me, tdata)
Lingo Code

on enterDoor(me,tdata)
  if not listp(tdata) then
    return(error(me, "Room data struct expected!", #enterDoor, #major))
  end if
  if pEnterDoorLocked then
    pEnterDoorData = tdata
    return(1)
  end if
  if tdata.getAt(#id) <> pSaveData.getAt(#id) then
    me.leaveRoom(1)
    tReConnect = 1
  else
    getObject(#session).set("target_door_ID", 0)
    tReConnect = 0
  end if
  tCurrentScale = me.getRoomScale(pSaveData.getAt(#marker))
  tCurrentRoomCasts = pSaveData.getAt(#casts)
  pRoomId = "private"
  pTrgDoorID = tdata.getAt(#id)
  pSaveData = tdata.duplicate()
  pSaveData.setAt(#type, #private)
  getObject(#session).set("lastroom", pSaveData.duplicate())
  if me.getRoomScale(pSaveData.getAt(#marker)) = #small and tCurrentScale = #large and not pPrvRoomsReady then
    pSaveData.setAt(#casts, tCurrentRoomCasts)
    if voidp(tCurrentRoomCasts) then
      pSaveData.setAt(#casts, ["hh_room_private"])
    end if
    me.loadRoomCasts()
    pPrvRoomsReady = 1
    return(0)
  end if
  if tReConnect then
    return(me.roomCastLoaded())
  else
    return(me.getRoomConnection().send("GOVIADOOR", pTrgDoorID & "/" & pSaveData.getAt(#teleport)))
  end if
  exit
end

5: leaveRoom(me, tJumpingToSubUnit)
Lingo Code

on leaveRoom(me,tJumpingToSubUnit)
  if pRoomId = "" then
    return(0)
  end if
  removePrepare(me.getID())
  if objectExists(pRoomPrgID) then
    removeObject(pRoomPrgID)
  end if
  if not pCacheFlag then
    getObject(#cache).Remove(pCacheKey)
  end if
  if objectExists(#furniChooser) then
    getObject(#furniChooser).close()
  end if
  pActiveFlag = 0
  if not tJumpingToSubUnit then
    pRoomId = ""
  end if
  me.getShadowManager().disableRender(1)
  if listp(pUserObjList) then
    call(#deconstruct, pUserObjList)
  end if
  if listp(pActiveObjList) then
    call(#deconstruct, pActiveObjList)
  end if
  if listp(pPassiveObjList) then
    call(#deconstruct, pPassiveObjList)
  end if
  if listp(pItemObjList) then
    call(#deconstruct, pItemObjList)
  end if
  me.getShadowManager().disableRender(0)
  pUserObjList = []
  pActiveObjList = []
  pPassiveObjList = []
  pItemObjList = []
  if objectExists(pBalloonId) then
    getObject(pBalloonId).removeBalloons()
  end if
  me.getInterface().hideAll()
  getObject(#session).Remove("user_index")
  getObject(#session).set("room_owner", 0)
  getObject(#session).set("room_controller", 0)
  return(1)
  exit
end

6: enterRoomDirect(me, tdata)
Lingo Code

on enterRoomDirect(me,tdata)
  if tdata.getAt(#type) = #private then
    pRoomId = "private"
  else
    pRoomId = tdata.getAt(#id)
  end if
  pTrgDoorID = void()
  pSaveData = tdata
  getObject(#session).set("lastroom", pSaveData)
  if pSaveData.getAt(#type) = #private then
    tRoomID = integer(pSaveData.getAt(#id))
    tDoorID = 0
    tTypeID = 0
  else
    tRoomID = integer(pSaveData.getAt(#port))
    tDoorID = integer(pSaveData.getAt(#door))
    tTypeID = 1
  end if
  if tDoorID.ilk = #void then
    tDoorID = 0
  end if
  return(getConnection(pRoomConnID).send(#room_directory, [#boolean:tTypeID, #integer:tRoomID, #integer:tDoorID]))
  exit
end

7: createUserObject(me, tdata)
Lingo Code

on createUserObject(me,tdata)
  if me.userObjectExists(tdata.getAt(#id)) then
    me.removeUserObject(tdata.getAt(#id))
  end if
  if me.createRoomObject(tdata, pUserObjList, "user") then
    return(executeMessage(#create_user, tdata.getAt(#name), tdata.getAt(#id)))
  else
    return(0)
  end if
  exit
end

8: removeUserObject(me, tID)
Lingo Code

on removeUserObject(me,tID)
  if me.removeRoomObject(tID, pUserObjList) then
    return(executeMessage(#remove_user, tID))
  else
    return(0)
  end if
  exit
end

9: getUserObject(me, tID)
Lingo Code

on getUserObject(me,tID)
  tObj = me.getRoomObject(tID, pUserObjList)
  return(tObj)
  exit
end

10: getUsersRoomId(me, tUserName)
Lingo Code

on getUsersRoomId(me,tUserName)
  tIndex = -1
  tPos = 1
  repeat while tPos <= pUserObjList.count
    tuser = pUserObjList.getAt(tPos)
    tClass = tuser.getClass()
    if tClass = "user" then
      if tuser.getName() = tUserName then
        tIndex = pUserObjList.getPropAt(tPos)
        exit repeat
      end if
    end if
    tPos = 1 + tPos
  end repeat
  return(tIndex)
  exit
end

11: userObjectExists(me, tID)
Lingo Code

on userObjectExists(me,tID)
  return(me.roomObjectExists(tID, pUserObjList))
  exit
end

12: createActiveObject(me, tdata)
Lingo Code

on createActiveObject(me,tdata)
  if me.activeObjectExists(tdata.getAt(#id)) then
    me.removeActiveObject(tdata.getAt(#id))
  end if
  return(me.createRoomObject(tdata, pActiveObjList, "active"))
  exit
end

13: removeActiveObject(me, tID)
Lingo Code

on removeActiveObject(me,tID)
  return(me.removeRoomObject(tID, pActiveObjList))
  exit
end

14: getActiveObject(me, tID)
Lingo Code

on getActiveObject(me,tID)
  return(me.getRoomObject(tID, pActiveObjList))
  exit
end

15: activeObjectExists(me, tID)
Lingo Code

on activeObjectExists(me,tID)
  return(me.roomObjectExists(tID, pActiveObjList))
  exit
end

16: releaseSpritesFromActiveObjects(me)
Lingo Code

on releaseSpritesFromActiveObjects(me)
  tRemoveCountMax = 100
  tActiveObjCount = pActiveObjList.count - 1
  tRemoveCount = min([tRemoveCountMax, tActiveObjCount])
  tNo = 1
  repeat while tNo <= tRemoveCount
    tObject = pActiveObjList.getAt(tNo).deconstruct()
    tNo = 1 + tNo
  end repeat
  createTimeout(#releaseactivetimeout, 3000, #releaseActiveTimeoutCallback, me.getID(), void(), 1)
  exit
end

17: releaseActiveTimeoutCallback(me)
Lingo Code

on releaseActiveTimeoutCallback(me)
  executeMessage(#alert, [#Msg:"alert_too_much_furnitures", #modal:1])
  exit
end

18: createPassiveObject(me, tdata)
Lingo Code

on createPassiveObject(me,tdata)
  if me.passiveObjectExists(tdata.getAt(#id)) then
    me.removePassiveObject(tdata.getAt(#id))
  end if
  return(me.createRoomObject(tdata, pPassiveObjList, "passive"))
  exit
end

19: removePassiveObject(me, tID)
Lingo Code

on removePassiveObject(me,tID)
  return(me.removeRoomObject(tID, pPassiveObjList))
  exit
end

20: getPassiveObject(me, tID)
Lingo Code

on getPassiveObject(me,tID)
  return(me.getRoomObject(tID, pPassiveObjList))
  exit
end

21: passiveObjectExists(me, tID)
Lingo Code

on passiveObjectExists(me,tID)
  return(me.roomObjectExists(tID, pPassiveObjList))
  exit
end

22: createItemObject(me, tdata)
Lingo Code

on createItemObject(me,tdata)
  if me.itemObjectExists(tdata.getAt(#id)) then
    me.removeItemObject(tdata.getAt(#id))
  end if
  return(me.createRoomObject(tdata, pItemObjList, "item"))
  exit
end

23: removeItemObject(me, tID)
Lingo Code

on removeItemObject(me,tID)
  return(me.removeRoomObject(tID, pItemObjList))
  exit
end

24: getItemObject(me, tID)
Lingo Code

on getItemObject(me,tID)
  return(me.getRoomObject(tID, pItemObjList))
  exit
end

25: itemObjectExists(me, tID)
Lingo Code

on itemObjectExists(me,tID)
  return(me.roomObjectExists(tID, pItemObjList))
  exit
end

26: setRoomRating(me, tRoomRating, tRoomRatingPercent)
Lingo Code

on setRoomRating(me,tRoomRating,tRoomRatingPercent)
  pFlatRatings.setAt(#rate, tRoomRating)
  pFlatRatings.setAt(#Percent, tRoomRatingPercent)
  exit
end

27: getRoomRating(me)
Lingo Code

on getRoomRating(me)
  return(pFlatRatings)
  exit
end

28: setRoomEvent(me, tEventData)
Lingo Code

on setRoomEvent(me,tEventData)
  pRoomEventCurrent = tEventData
  executeMessage(#roomEventInfoUpdated)
  exit
end

29: getRoomEvent(me)
Lingo Code

on getRoomEvent(me)
  return(pRoomEventCurrent)
  exit
end

30: setRoomEventList(me, ttype, tEvents)
Lingo Code

on setRoomEventList(me,ttype,tEvents)
  pRoomEventList.setaProp(ttype, [#data:tEvents, #time:the milliSeconds])
  executeMessage(#roomEventsUpdated)
  exit
end

31: getRoomEventList(me, ttype)
Lingo Code

on getRoomEventList(me,ttype)
  if ttype = 0 then
    return(0)
  end if
  tEventList = pRoomEventList.getaProp(ttype)
  if not voidp(tEventList) then
    tAge = the milliSeconds - tEventList.getaProp(#time)
  end if
  tCache = getIntVariable("roomevent.cache", 10000)
  if voidp(tEventList) or tAge > tCache then
    me.getRoomConnection().send("GET_ROOMEVENTS_BY_TYPE", [#integer:integer(ttype)])
    pRoomEventList.setaProp(ttype, [#data:[], #time:the milliSeconds])
  end if
  tEventList = pRoomEventList.getaProp(ttype)
  return(tEventList.getaProp(#data))
  exit
end

32: setRoomEventTypeCount(me, tCount)
Lingo Code

on setRoomEventTypeCount(me,tCount)
  pRoomEventTypeCount = tCount
  executeMessage(#roomEventTypeCountUpdated)
  exit
end

33: getRoomEventTypeCount(me)
Lingo Code

on getRoomEventTypeCount(me)
  if voidp(pRoomEventTypeCount) then
    me.getRoomConnection().send("GET_ROOMEVENT_TYPE_COUNT")
    pRoomEventTypeCount = 0
  end if
  return(pRoomEventTypeCount)
  exit
end

34: getRoomPrg(me)
Lingo Code

on getRoomPrg(me)
  return(getObject(pRoomPrgID))
  exit
end

35: getRoomID(me)
Lingo Code

on getRoomID(me)
  return(pRoomId)
  exit
end

36: getRoomData(me)
Lingo Code

on getRoomData(me)
  if voidp(pSaveData) then
    return(0)
  else
    return(pSaveData)
  end if
  exit
end

37: getRoomConnection(me)
Lingo Code

on getRoomConnection(me)
  return(getConnection(pRoomConnID))
  exit
end

38: getBalloon(me)
Lingo Code

on getBalloon(me)
  return(getObject(pBalloonId))
  exit
end

39: getAd(me)
Lingo Code

on getAd(me)
  return(getObject(pAdSystemID))
  exit
end

40: getInterstitial(me)
Lingo Code

on getInterstitial(me)
  if objectExists(pInterstitialSystemID) then
    return(getObject(pInterstitialSystemID))
  else
    return(error(me, "Interstitial manager not found", #getInterstitial, #major))
  end if
  exit
end

41: getClassContainer(me)
Lingo Code

on getClassContainer(me)
  return(getObject(pClassContId))
  exit
end

42: isCreditFurniClass(me, tClass)
Lingo Code

on isCreditFurniClass(me,tClass)
  if getObject(pClassContId).exists(tClass) then
    tClasses = value(getObject(pClassContId).GET(tClass))
    if tClasses.getOne("Credit Furni Class") > 0 then
      return(1)
    end if
  end if
  return(0)
  exit
end

43: getOwnUser(me)
Lingo Code

on getOwnUser(me)
  return(me.getUserObject(getObject(#session).GET("user_index")))
  exit
end

44: getShadowManager(me)
Lingo Code

on getShadowManager(me)
  if objectExists(pShadowManagerID) then
    return(getObject(pShadowManagerID))
  else
    return(error(me, "Shadow manager not found", #getShadowManager, #major))
  end if
  exit
end

45: getGroupInfoObject(me)
Lingo Code

on getGroupInfoObject(me)
  return(getObject(pGroupInfoID))
  exit
end

46: roomExists(me, tRoomID)
Lingo Code

on roomExists(me,tRoomID)
  if voidp(tRoomID) then
    return(pActiveFlag)
  else
    return(pRoomId = tRoomID)
  end if
  exit
end

47: sendChat(me, tChat)
Lingo Code

on sendChat(me,tChat)
  if voidp(tChat) then
    return(0)
  end if
  if tChat = "" then
    return(0)
  end if
  tChat = convertSpecialChars(tChat, 1)
  if tChat.getProp(#char, 1) = ":" then
    if tChat.getProp(#word, 1) = ":crashme" then
      if getObject(#session).GET("user_rights").getOne("fuse_any_room_controller") then
        tTemp = ""
        return(tTemp.getAt(#thisIsNotListAndWillCrash))
      end if
    else
      if ERROR = ":chooser" then
        if getObject(#session).GET("user_rights").getOne("fuse_habbo_chooser") then
          return(createObject(#chooser, "User Chooser Class"))
        end if
      else
        if ERROR = ":furni" then
          if pSaveData.getAt(#type) <> #private then
            return(1)
          end if
          if getObject(#session).GET("user_rights").getOne("fuse_furni_chooser") then
            if not objectExists(pFurniChooserID) then
              createObject(pFurniChooserID, "Furni Chooser Class")
            end if
            if getObject(pFurniChooserID) = 0 then
              return(0)
            end if
            return(getObject(pFurniChooserID).showList())
          end if
        else
          if ERROR = ":performance" then
            if getObject(#session).GET("user_rights").getOne("fuse_performance_panel") then
              return(performance())
            end if
          else
            if ERROR = ":editcatalogue" then
              if getObject(#session).GET("user_rights").getOne("fuse_catalog_editor") then
                return(executeMessage("edit_catalogue"))
              end if
            else
              if ERROR = ":copypaste" then
                if getObject(#session).GET("user_rights").getOne("fuse_debug_window") then
                  the editShortcutsEnabled = 1
                  return(1)
                end if
              else
                if ERROR = ":petcontrol" then
                  if getObject(#session).GET("user_rights").getOne("fuse_debug_window") then
                    petcontrol()
                    return(1)
                  end if
                else
                  if ERROR = ":events" then
                    if variableExists("disable.roomevents") then
                      if getIntVariable("disable.roomevents") then
                        return(1)
                      end if
                    end if
                    if objectExists(pRoomEventBrowserID) then
                      removeObject(pRoomEventBrowserID)
                    else
                      createObject(pRoomEventBrowserID, "RoomEvent Browser Class")
                    end if
                    return(1)
                  else
                    if ERROR = ":ig" then
                      executeMessage(#toggle_ig)
                      return(1)
                    end if
                  end if
                end if
              end if
            end if
          end if
        end if
      end if
    end if
  end if
  if getObject(#session).GET("user_rights").getOne("fuse_debug_window") then
    tKeywords = me.getInterface().getKeywords()
    if tChat.getProp(#word, 1) <> "!!" & tKeywords.getAt(1) then
      if ERROR = "!!" & tKeywords.getAt(2) then
        tInfoID = getVariable("connection.info.id")
        getConnection(#info).pD = 1
        the debugPlaybackEnabled = 1
        if tChat.getProp(#word, 1) = tKeywords.getAt(1) then
          if connectionExists(tInfoID) then
            getConnection(tInfoID).setLogMode(1)
          end if
        else
          if ERROR = tKeywords.getAt(2) then
            if connectionExists(tInfoID) then
              getConnection(tInfoID).setLogMode(0)
            end if
          end if
        end if
        return(1)
      end if
      tKeywords = void()
      if the shiftDown then
        tMode = "SHOUT"
      else
        tMode = pChatProps.getAt("mode")
      end if
      tSelected = me.getInterface().getSelectedObject()
      if me.userObjectExists(tSelected) then
        tSelected = me.getUserObject(tSelected).getName()
      else
        tSelected = ""
      end if
      if pChatProps.getAt("hobbaCmds").getOne(tChat.getProp(#word, 1, 2)) then
        tMode = "CHAT"
        if tChat.getProp(#word, 2) = "x" then
          if tSelected = "" then
            tMode = "WHISPER"
            tMsg = getText("chat_user_not_found", "User not found.")
            tID = getObject(#session).GET("user_index")
            me.getComponent().getBalloon().enterChatMessage(tMode, tID, tMsg)
            return(1)
          end if
          tOffsetX = offset("x", tChat)
          tChat = tChat.getProp(#char, 1, tOffsetX - 1) & tSelected & tChat.getProp(#char, tOffsetX + 1, tChat.length)
        end if
      else
        if tMode = "WHISPER" then
          tChat = tSelected && tChat
        end if
      end if
      return(me.getRoomConnection().send(tMode, [#string:tChat]))
      exit
    end if
  end if
end

48: setChatMode(me, tMode, tUpdate)
Lingo Code

on setChatMode(me,tMode,tUpdate)
  if tMode = "whisper" then
    pChatProps.setAt("mode", "WHISPER")
  else
    if ERROR = "shout" then
      pChatProps.setAt("mode", "SHOUT")
    else
      pChatProps.setAt("mode", "CHAT")
    end if
  end if
  if tUpdate then
    me.getInterface().setSpeechDropdown(tMode)
  end if
  return(1)
  exit
end

49: setUserTypingStatus(me, tUserID, tStatus)
Lingo Code

on setUserTypingStatus(me,tUserID,tStatus)
  tUserObject = me.getUserObject(tUserID)
  if tUserObject <> 0 then
    tUserObject.setUserTypingStatus(tStatus)
  end if
  exit
end

50: print(me)
Lingo Code

on print(me)
  put("\r" & "User objects:" & "\r")
  i = 1
  repeat while i <= pUserObjList.count
    put(pUserObjList.getPropAt(i) & ":" && pUserObjList.getAt(i))
    i = 1 + i
  end repeat
  put("\r" & "Active objects:" & "\r")
  i = 1
  repeat while i <= pActiveObjList.count
    put(pActiveObjList.getPropAt(i) & ":" && pActiveObjList.getAt(i))
    i = 1 + i
  end repeat
  put("\r" & "Passive objects:" & "\r")
  i = 1
  repeat while i <= pPassiveObjList.count
    put(pPassiveObjList.getPropAt(i) & ":" && pPassiveObjList.getAt(i))
    i = 1 + i
  end repeat
  exit
end

51: addSlideObject(me, tID, tFromLoc, tToLoc, tTimeNow, tHasCharacter)
Lingo Code

on addSlideObject(me,tID,tFromLoc,tToLoc,tTimeNow,tHasCharacter)
  if the paramCount < 4 then
    return(error(me, "Wrong parameter count", #addSlideObject, #major))
  end if
  tID = tID.string
  if voidp(tTimeNow) then
    tTimeNow = the milliSeconds
  end if
  if voidp(tHasCharacter) then
    tHasCharacter = 0
  end if
  if not voidp(pActiveObjList.getAt(tID)) then
    tObj = pActiveObjList.getAt(tID)
    tObj.setSlideTo(tFromLoc, tToLoc, tTimeNow, tHasCharacter)
    pCurrentSlidingObjects.setAt(tID, tObj)
  end if
  exit
end

52: removeSlideObject(me, tID)
Lingo Code

on removeSlideObject(me,tID)
  tID = tID.string
  if not voidp(pCurrentSlidingObjects.getAt(tID)) then
    pCurrentSlidingObjects.deleteProp(tID)
  end if
  exit
end

53: roomPrePartFinished(me)
Lingo Code

on roomPrePartFinished(me)
  tInterstFinished = getInterstitial().isAdFinished()
  if pCastLoaded = 0 or tInterstFinished = 0 then
    return(0)
  end if
  if pSaveData.getAt(#type) = #private then
    tRoomID = integer(pSaveData.getAt(#id))
    tDoorID = 0
    tTypeID = 0
  else
    tRoomID = integer(pSaveData.getAt(#port))
    tDoorID = integer(pSaveData.getAt(#door))
    tTypeID = 1
  end if
  if tDoorID.ilk = #void then
    tDoorID = 0
  end if
  return(getConnection(pRoomConnID).send(#room_directory, [#boolean:tTypeID, #integer:tRoomID, #integer:tDoorID]))
  return(1)
  exit
end

54: getSpectatorMode(me)
Lingo Code

on getSpectatorMode(me)
  tModeMgrObj = getObject(pSpectatorSystemID)
  if tModeMgrObj = 0 then
    return(error(me, "Spectator System missing!", #getSpectatorMode, #major))
  end if
  return(tModeMgrObj.getSpectatorMode())
  exit
end

55: setSpectatorMode(me, tstate)
Lingo Code

on setSpectatorMode(me,tstate)
  tModeMgrObj = getObject(pSpectatorSystemID)
  if tModeMgrObj = 0 then
    return(error(me, "Spectator System missing!", #setSpectatorMode, #major))
  end if
  if tstate then
    getObject(#session).set("user_index", -1000)
  end if
  tRoomData = me.getRoomData()
  if tRoomData = 0 then
    tRoomType = #public
  else
    tRoomType = tRoomData.getAt(#type)
  end if
  return(tModeMgrObj.setSpectatorMode(tstate, tRoomType))
  exit
end

56: pickAndGoCFH(me, tSender)
Lingo Code

on pickAndGoCFH(me,tSender)
  if not stringp(tSender) then
    return(0)
  end if
  pPickedCryName = tSender
  return(1)
  exit
end

57: getPickedCryName(me)
Lingo Code

on getPickedCryName(me)
  return(pPickedCryName)
  exit
end

58: showCfhSenderDelayed(me, tID)
Lingo Code

on showCfhSenderDelayed(me,tID)
  pPickedCryName = ""
  return(me.getInterface().showCfhSenderDelayed(tID))
  exit
end

59: updateCharacterFigure(me, tUserID, tUserFigure, tsex, tUserCustomInfo)
Lingo Code

on updateCharacterFigure(me,tUserID,tUserFigure,tsex,tUserCustomInfo)
  if voidp(tUserID) or voidp(tUserFigure) or voidp(tUserCustomInfo) then
    return(0)
  end if
  tUserID = string(tUserID)
  tSession = getObject(#session)
  tFigureParser = getObject("Figure_System")
  tParsedFigure = tFigureParser.parseFigure(tUserFigure, tsex, "user")
  if tSession.GET("user_index") = tUserID or tUserID = "-1" then
    tSession.set("user_figure", tParsedFigure)
    tSession.set("user_sex", tsex)
    tSession.set("user_customData", tUserCustomInfo)
  end if
  if tSession.GET("lastroom") = "Entry" and tUserID = "-1" then
    executeMessage(#updateFigureData)
  else
    if not tSession.GET("lastroom") = "Entry" and integer(tUserID) > -1 then
      if voidp(pUserObjList.getAt(tUserID)) then
        return(0)
      end if
      tUserObj = pUserObjList.getAt(tUserID)
      tloc = tUserObj.getLocation()
      tdir = tUserObj.getDirection()
      tuser = []
      tuser.setAt(#figure, tParsedFigure)
      tuser.setAt(#custom, tUserCustomInfo)
      tuser.setAt(#sex, tsex)
      tUserObj.changeFigureAndData(tuser)
      tScale = #large
      if me.getInterface().getGeometry().getTileWidth() < 64 then
        tScale = #small
      end if
      tChangeEffect = createObject(#random, "Change Clothes Effect Class")
      tUserSprites = tUserObj.getSprites()
      tChangeEffect.defineWithSprite(tUserSprites.getAt(1), tScale)
      executeMessage(#updateInfostandAvatar, tUserObj)
    end if
  end if
  exit
end

60: updateSpectatorCount(me, tSpectatorCount, tSpectatorMax)
Lingo Code

on updateSpectatorCount(me,tSpectatorCount,tSpectatorMax)
  tModeMgrObj = getObject(pSpectatorSystemID)
  if tModeMgrObj = 0 then
    return(error(me, "Spectator System missing!", #updateSpectatorCount, #major))
  end if
  tModeMgrObj.updateSpectatorCount(tSpectatorCount, tSpectatorMax)
  exit
end

61: highlightUser(me, tUserID)
Lingo Code

on highlightUser(me,tUserID)
  repeat while count(pUserObjList) <= 1
    tuser = getAt()
    if tuser.getWebID() = tUserID then
      me.getInterface().eventProcUserObj(#mouseUp, tuser.getID())
      exit repeat
    end if
  end repeat
  exit
end

62: showHideRoomevents(me)
Lingo Code

on showHideRoomevents(me)
  if objectExists(pRoomEventBrowserID) then
    removeObject(pRoomEventBrowserID)
  else
    createObject(pRoomEventBrowserID, "RoomEvent Browser Class")
  end if
  return(1)
  exit
end

63: loadRoomCasts(me)
Lingo Code

on loadRoomCasts(me)
  if pRoomId = "" then
    return(0)
  end if
  tCastVarPrefix = "room.cast."
  tCastList = me.addToCastDownloadList(tCastVarPrefix, tCastList)
  if pSaveData.getAt(#type) = #public then
    pPrvRoomsReady = 0
  end if
  if pSaveData.getAt(#type) = #private then
    if me.getRoomScale(pSaveData.getAt(#marker)) = #small then
      tCastVarPrefix = "room.cast.small."
      tCastList = me.addToCastDownloadList(tCastVarPrefix, tCastList)
      pPrvRoomsReady = 1
    end if
  end if
  if tCastList.count > 0 then
    tCastLoadId = startCastLoad(tCastList, 1)
    registerCastloadCallback(tCastLoadId, #loadRoomCasts, me.getID())
    me.getInterface().showLoaderBar(tCastLoadId, getText("room_hold", getText("room_loading", "Hold on...")))
    return(1)
  end if
  if voidp(pSaveData.getAt(#casts)) then
    pSaveData.setAt(#casts, [])
  end if
  if pSaveData.getAt(#casts).count < 1 then
    error(me, "Cast for room not defined:" && pRoomId, #loadRoomCasts, #major)
    me.getInterface().hideLoaderBar()
    executeMessage(#leaveRoom)
  end if
  tCastLoadId = startCastLoad(pSaveData.getAt(#casts), 0)
  registerCastloadCallback(tCastLoadId, #roomCastLoaded, me.getID())
  me.getInterface().showLoaderBar(tCastLoadId, getText("room_loading", "Loading room") & "\r" & "\"" & pSaveData.getAt(#name) & "\"")
  return(1)
  exit
end

64: roomCastLoaded(me)
Lingo Code

on roomCastLoaded(me)
  if pRoomId = "" then
    pRoomId = "null"
    executeMessage(#leaveRoom)
    return(error(me, "Room building process is aborted!", #roomCastLoaded, #major))
  end if
  if voidp(pTrgDoorID) then
    tTxt = getText("room_preparing", "...preparing room.")
    if pSaveData.getAt(#type) = #private then
      if pSaveData.getAt(#door) = "closed" then
        if pSaveData.getAt(#owner) <> getObject(#session).GET("user_name") then
          tTxt = getText("room_waiting", "...waiting.")
        end if
      end if
    end if
    me.getInterface().showLoaderBar(void(), "\"" & pSaveData.getAt(#name) & "\"" & "\r" & tTxt)
    tRoomCasts = pSaveData.getAt(#casts)
    repeat while count(tRoomCasts) <= 1
      tCast = getAt()
      if not castExists(tCast) then
        error(me, "Cast required by room not found:" && tCast, #roomCastLoaded, #major)
        return(executeMessage(#leaveRoom))
      end if
    end repeat
  end if
  pCastLoaded = 1
  me.roomPrePartFinished()
  exit
end

65: roomConnected(me, tMarker, tstate)
Lingo Code

on roomConnected(me,tMarker,tstate)
  if pRoomId = "" then
    pRoomId = "null"
    executeMessage(#leaveRoom)
    return(error(me, "Room building process is aborted!", #roomConnected, #major))
  end if
  if not voidp(pTrgDoorID) then
    if tstate = "OPC_OK" then
      tValue = me.getRoomConnection().send("GOVIADOOR", pTrgDoorID & "/" & pSaveData.getAt(#teleport))
      pTrgDoorID = void()
      return(tValue)
    end if
  end if
  if pSaveData.getAt(#type) = #private then
    if tstate = "OPC_OK" then
      tStr = pSaveData.getAt(#id)
      if threadExists(#navigator) then
        tPassword = getThread(#navigator).getComponent().getFlatPassword(pSaveData.getAt(#id))
        if tPassword <> 0 then
          tStr = tStr & "/" & tPassword
        end if
      end if
      return(me.getRoomConnection().send("TRYFLAT", tStr))
    else
      if tstate = "FLAT_LETIN" then
        return(me.getRoomConnection().send("GOTOFLAT", pSaveData.getAt(#id)))
      end if
    end if
  end if
  if voidp(tMarker) then
    error(me, "Missing room marker!!!", #roomConnected, #major)
  end if
  pSaveData.setAt(#marker, tMarker)
  me.leaveRoom(1)
  if not me.getInterface().showRoom(tMarker) then
    return(executeMessage(#leaveRoom))
  end if
  if connectionExists(pRoomConnID) then
    getConnection(pRoomConnID).send("GETROOMAD")
  end if
  if memberExists(pSaveData.getAt(#marker) && "Class") then
    createObject(pRoomPrgID, pSaveData.getAt(#marker) && "Class")
  end if
  if pSaveData.getAt(#type) = #private then
    pProcessList = [#passive:0, #Active:0, #users:0, #items:0, #heightmap:0]
  else
    if pSaveData.getAt(#type) = #public then
      pProcessList = [#passive:0, #Active:0, #users:0, #items:1, #heightmap:0]
    else
      if pSaveData.getAt(#type) = #game then
        pProcessList = [#passive:1, #Active:1, #users:1, #items:1, #heightmap:0]
      end if
    end if
  end if
  pCacheKey = "room_data_" & pRoomId & "_" & pSaveData.getAt(#marker)
  if not getObject(#cache).exists(pCacheKey) then
    getObject(#cache).set(pCacheKey, [])
  end if
  tCache = getObject(#cache).GET(pCacheKey)
  if voidp(tCache.getAt(#heightmap)) and not pProcessList.getAt(#heightmap) then
    tCache.setAt(#heightmap, "")
    me.getRoomConnection().send("G_HMAP")
  else
    me.validateHeightMap(tCache.getAt(#heightmap))
  end if
  tShadowManager = me.getShadowManager()
  tShadowManager.define("roomShadow")
  tCache.setAt(#users, [])
  if not pProcessList.getAt(#users) then
    me.getRoomConnection().send("G_USRS")
  end if
  if voidp(tCache.getAt(#passive)) and not pProcessList.getAt(#passive) then
    tCache.setAt(#passive, [])
    me.getRoomConnection().send("G_OBJS")
  else
    if voidp(tCache.getAt(#passive)) then
      tCache.setAt(#passive, [])
    end if
    me.validatePassiveObjects(0)
  end if
  if voidp(tCache.getAt(#Active)) and not pProcessList.getAt(#Active) then
    tCache.setAt(#Active, [])
  else
    if voidp(tCache.getAt(#Active)) then
      tCache.setAt(#Active, [])
    end if
    me.validateActiveObjects(0)
  end if
  if voidp(tCache.getAt(#items)) and not pProcessList.getAt(#items) then
    tCache.setAt(#items, [])
    me.getRoomConnection().send("G_ITEMS")
  else
    if voidp(tCache.getAt(#items)) then
      tCache.setAt(#items, [])
    end if
    me.validateItemObjects(0)
  end if
  createTimeout(pRoomPollerID, 1000, #pollRoomMessages, me.getID(), void(), 0)
  me.executeEnterRoomAlert()
  return(1)
  exit
end

66: roomDisconnected(me)
Lingo Code

on roomDisconnected(me)
  pPrvRoomsReady = 0
  me.leaveRoom()
  return(executeMessage(#leaveRoom))
  exit
end

67: validateHeightMap(me, tdata)
Lingo Code

on validateHeightMap(me,tdata)
  if not getObject(#cache).exists(pCacheKey) then
    return(error(me, "Data not expected yet!", #validateHeightMap, #major))
  end if
  me.getInterface().getGeometry().loadHeightMap(tdata)
  me.pHeightMapData = tdata
  if not pActiveFlag then
    getObject(#cache).GET(pCacheKey).setaProp(#heightmap, tdata)
    me.updateProcess(#heightmap, 1)
  end if
  return(0)
  exit
end

68: updateHeightMap(me, tdata)
Lingo Code

on updateHeightMap(me,tdata)
  tHeightMapData = pHeightMapData
  if voidp(tHeightMapData) then
    return(error(me, "Height map update data sent but heightmap data not cached!", #updateHeightMap, #major))
  else
    a = 1
    i = 1
    repeat while i <= tdata.length
      if tdata.getProp(#char, i) = "!" then
        i = i + 1
        a = a + charToNum(tdata.getProp(#char, i))
      else
        #char.setContents(a.getPropRef())
        a = a + 1
      end if
      i = 1 + i
    end repeat
    return(validateHeightMap(me, tHeightMapData))
  end if
  exit
end

69: validateUserObjects(me, tdata)
Lingo Code

on validateUserObjects(me,tdata)
  if not getObject(#cache).exists(pCacheKey) then
    return(error(me, "Data not expected yet!", #validateUserObjects, #major))
  end if
  if tdata <> 0 then
    getObject(#cache).GET(pCacheKey).getaProp(#users).add(tdata)
  end if
  if pActiveFlag and tdata <> 0 then
    me.createUserObject(tdata)
  else
    me.updateProcess(#users, 1)
  end if
  return(1)
  exit
end

70: validateActiveObjects(me, tdata)
Lingo Code

on validateActiveObjects(me,tdata)
  if not getObject(#cache).exists(pCacheKey) then
    return(error(me, "Data not expected yet!", #validateActiveObjects, #major))
  end if
  if tdata <> 0 then
    getObject(#cache).GET(pCacheKey).getaProp(#Active).add(tdata)
  end if
  if pActiveFlag and tdata <> 0 then
    me.createActiveObject(tdata)
  else
    me.updateProcess(#Active, 1)
  end if
  return(1)
  exit
end

71: validatePassiveObjects(me, tdata)
Lingo Code

on validatePassiveObjects(me,tdata)
  if not getObject(#cache).exists(pCacheKey) then
    return(error(me, "Data not expected yet!", #validatePassiveObjects, #major))
  end if
  if tdata <> 0 then
    getObject(#cache).GET(pCacheKey).getaProp(#passive).add(tdata)
  end if
  if pActiveFlag and tdata <> 0 then
    me.createPassiveObject(tdata)
  else
    me.updateProcess(#passive, 1)
  end if
  return(1)
  exit
end

72: validateItemObjects(me, tdata)
Lingo Code

on validateItemObjects(me,tdata)
  if not getObject(#cache).exists(pCacheKey) then
    return(error(me, "Data not expected yet!", #validateItemObjects, #major))
  end if
  if tdata <> 0 then
    getObject(#cache).GET(pCacheKey).getaProp(#items).add(tdata)
  end if
  if pActiveFlag and tdata <> 0 then
    me.createItemObject(tdata)
  else
    me.updateProcess(#items, 1)
  end if
  return(1)
  exit
end

73: pollRoomMessages(me)
Lingo Code

on pollRoomMessages(me)
  if not me.getRoomConnection() and timeoutExists(pRoomPollerID) then
    return(removeTimeout(pRoomPollerID))
  end if
  if me.getRoomConnection().getWaitingMessagesCount() > 0 then
    me.getRoomConnection().processWaitingMessages()
  end if
  exit
end

74: updateProcess(me, tKey, tValue)
Lingo Code

on updateProcess(me,tKey,tValue)
  if pActiveFlag then
    return(error(me, "Attempted to remake room!", #updateProcess, #major))
  end if
  if pProcessList.getAt(tKey) = 0 then
    pProcessList.setAt(tKey, tValue)
  end if
  repeat while count(pProcessList) <= 1
    tProcess = getAt()
    if not tProcess then
      exit repeat
    end if
  end repeat
  if tProcess = 1 then
    if timeoutExists(pRoomPollerID) then
      removeTimeout(pRoomPollerID)
    end if
    tCache = getObject(#cache).GET(pCacheKey)
    repeat while count(tCache.getAt(#passive)) <= 1
      tdata = getAt(ERROR + 1)
      me.createPassiveObject(tdata)
    end repeat
    me.getShadowManager().disableRender(1)
    repeat while count(tCache.getAt(#Active)) <= 1
      tdata = getAt(ERROR + 1)
      me.createActiveObject(tdata)
    end repeat
    me.getShadowManager().disableRender(0)
    me.getShadowManager().render()
    repeat while count(tCache.getAt(#items)) <= 1
      tdata = getAt(ERROR + 1)
      me.createItemObject(tdata)
    end repeat
    repeat while count(tCache.getAt(#users)) <= 1
      tdata = getAt(ERROR + 1)
      me.createUserObject(tdata)
    end repeat
    tCache.setAt(#users, [])
    tCache.setAt(#Active, [])
    tCache.setAt(#items, [])
    me.getInterface().showRoomBar()
    me.getInterface().hideLoaderBar()
    me.getInterface().hideTrashCover()
    pActiveFlag = 1
    pChatProps.setAt("mode", "CHAT")
    setcursor(#arrow)
    call(#prepare, [me.getRoomPrg()])
    executeMessage(#roomReady)
    me.getRoomConnection().send("G_STAT")
    return(receivePrepare(me.getID()))
  end if
  return(0)
  exit
end

75: createRoomObject(me, tdata, tList, tClass)
Lingo Code

on createRoomObject(me,tdata,tList,tClass)
  if tdata = 0 then
    return(0)
  end if
  if voidp(tdata.getAt(#id)) or not listp(tList) then
    return(error(me, "Invalid arguments in object creation!", #createRoomObject, #major))
  end if
  if not voidp(tList.getAt(tdata.getAt(#id))) then
    return(error(me, "Object already exists:" && tdata.getAt(#id), #createRoomObject, #major))
  end if
  if voidp(tClass) then
    tClass = "passive"
  end if
  tdata = getThread(#buffer).getComponent().processObject(tdata, tClass)
  tCustomCls = tdata.getAt(#class)
  if tCustomCls contains "*" then
    tDelim = the itemDelimiter
    the itemDelimiter = "*"
    tCustomCls = tCustomCls.getProp(#item, 1)
    the itemDelimiter = tDelim
  end if
  if not voidp(tdata.getAt(#type)) then
    if getObject(pClassContId).exists(tCustomCls & tdata.getAt(#type)) then
      tCustomCls = tCustomCls & tdata.getAt(#type)
    end if
  end if
  if getObject(pClassContId).exists(tCustomCls) then
    tClasses = value(getObject(pClassContId).GET(tCustomCls))
  else
    tClasses = value(getObject(pClassContId).GET(tClass))
  end if
  tObject = createObject(#temp, tClasses)
  if not objectp(tObject) then
    return(error(me, "Failed to create room object:" && tdata, #createRoomObject, #major))
  end if
  tObject.setID(tdata.getAt(#id))
  tSuccess = tObject.define(tdata.duplicate())
  if not tSuccess then
    tObject.deconstruct()
    return(error(me, "Failed to define room object:" && tdata, #createRoomObject, #major))
  end if
  tList.setAt(tObject.getID(), tObject)
  return(1)
  exit
end

76: removeRoomObject(me, tID, tList)
Lingo Code

on removeRoomObject(me,tID,tList)
  if voidp(tList.getAt(tID)) then
    return(error(me, "Object not found:" && tID, #removeRoomObject, #minor))
  end if
  tList.getAt(tID).deconstruct()
  tList.deleteProp(tID)
  return(1)
  exit
end

77: getRoomObject(me, tID, tList)
Lingo Code

on getRoomObject(me,tID,tList)
  if tID = #list then
    return(tList)
  end if
  if voidp(tList.getaProp(tID)) then
    return(0)
  else
    return(tList.getaProp(tID))
  end if
  exit
end

78: roomObjectExists(me, tID, tList)
Lingo Code

on roomObjectExists(me,tID,tList)
  if not listp(tList) or voidp(tID) then
    return(0)
  end if
  if ilk(tID) = #string then
    if tID = "" then
      return(0)
    end if
  else
    if tID < 1 then
      return(0)
    end if
  end if
  return(not voidp(tList.getAt(tID)))
  exit
end

79: startTeleport(me, tTeleId, tFlatID)
Lingo Code

on startTeleport(me,tTeleId,tFlatID)
  getObject(#session).set("target_door_ID", tTeleId)
  getObject(#session).set("target_flat_ID", tFlatID)
  return(executeMessage(#requestRoomData, tFlatID, #private, [me.getID(), #processTeleportStruct]))
  exit
end

80: processTeleportStruct(me, tFlatStruct)
Lingo Code

on processTeleportStruct(me,tFlatStruct)
  if not listp(tFlatStruct) then
    return(0)
  end if
  tFlatStruct = tFlatStruct.duplicate()
  tFlatStruct.setAt(#id, tFlatStruct.getAt(#flatId))
  tFlatStruct.addProp(#teleport, getObject(#session).GET("target_door_ID"))
  getObject(#session).Remove("target_flat_id")
  if getObject(#session).exists("current_door_ID") then
    tDoorID = getObject(#session).GET("current_door_ID")
    tDoorObj = me.getComponent().getActiveObject(tDoorID)
    if tDoorObj <> 0 then
      tDoorObj.startTeleport(tFlatStruct)
    end if
  end if
  exit
end

81: updateSlideObjects(me, tTimeNow)
Lingo Code

on updateSlideObjects(me,tTimeNow)
  if voidp(tTimeNow) then
    tTimeNow = the milliSeconds
  end if
  tList = pCurrentSlidingObjects.duplicate()
  call(#animateSlide, tList, tTimeNow)
  exit
end

82: setEnterRoomAlert(me, tMsg)
Lingo Code

on setEnterRoomAlert(me,tMsg)
  pEnterRoomAlert = tMsg
  exit
end

83: executeEnterRoomAlert(me)
Lingo Code

on executeEnterRoomAlert(me)
  if pEnterRoomAlert.length > 0 then
    executeMessage(#alert, [#Msg:pEnterRoomAlert])
    pEnterRoomAlert = ""
  end if
  exit
end

84: removeEnterRoomAlert(me)
Lingo Code

on removeEnterRoomAlert(me)
  pEnterRoomAlert = ""
  exit
end

85: getRoomScale(me, tRoomMarker)
Lingo Code

on getRoomScale(me,tRoomMarker)
  if voidp(tRoomMarker) then
    return(0)
  end if
  tRoomProps = getVariableValue("private.room.properties")
  if voidp(tRoomProps) then
    return(0)
  end if
  tRoomKey = chars(tRoomMarker, tRoomMarker.length, tRoomMarker.length)
  repeat while count(tRoomProps) <= 1
    tRoom = getAt()
    if tRoom.getAt(#model) = tRoomKey then
      return(tRoom.getAt(#charScale))
    end if
  end repeat
  return(0)
  exit
end

86: addToCastDownloadList(me, tCastVarPrefix, tCastList)
Lingo Code

on addToCastDownloadList(me,tCastVarPrefix,tCastList)
  if voidp(tCastList) or not listp(tCastList) then
    tCastList = []
  end if
  i = 1
  repeat while 1
    if variableExists(tCastVarPrefix & i) then
      tCast = getVariable(tCastVarPrefix & i)
      if not castExists(tCast) then
        tCastList.add(tCast)
      end if
    else
      exit repeat
    end if
    i = i + 1
  end repeat
  return(tCastList)
  exit
end

Handlers
0: construct(me)
Lingo Code

on construct(me)
  pSpectatorMode = 0
  pVisualizerId = "passive_tv_screen"
  pSpecCountId = "spec_count_id"
  pSpecCountTimerId = "spec_count_timer"
  pWriterBold = "dialog_writer_bold"
  tFontBold = getStructVariable("struct.font.bold")
  tFontBold.setaProp(#color, rgb(240, 240, 240))
  createWriter(pWriterBold, tFontBold)
  registerMessage(#leaveRoom, me.getID(), #hideSpectatorView)
  registerMessage(#changeRoom, me.getID(), #hideSpectatorView)
  return(1)
  exit
end

1: deconstruct(me)
Lingo Code

on deconstruct(me)
  unregisterMessage(#leaveRoom, me.getID())
  unregisterMessage(#changeRoom, me.getID())
  if windowExists(pSpecCountId) then
    removeWindow(pSpecCountId)
  end if
  if timeoutExists(pSpecCountTimerId) then
    removeTimeout(pSpecCountTimerId)
  end if
  if writerExists(pWriterBold) then
    removeWriter(pWriterBold)
  end if
  return(1)
  exit
end

2: getSpectatorMode(me)
Lingo Code

on getSpectatorMode(me)
  return(pSpectatorMode)
  exit
end

3: setSpectatorMode(me, tstate, tSpaceType)
Lingo Code

on setSpectatorMode(me,tstate,tSpaceType)
  if tstate = 1 then
    pSpectatorMode = 1
    me.showSpectatorView()
    me.getSpectatorCount()
    executeMessage(#spectatorMode_on)
  else
    pSpectatorMode = 0
    if tSpaceType = #public then
      if getConnection(#info) <> 0 then
        getConnection(#info).send("QUIT")
      end if
      executeMessage(#leaveRoom)
      executeMessage(#spectatorMode_off)
    else
      if ERROR = #private then
      else
        if ERROR = #game then
          executeMessage(#spectatorMode_off)
        end if
      end if
    end if
  end if
  return(1)
  exit
end

4: updateSpectatorCount(me, tSpectatorCount, tSpectatorMax)
Lingo Code

on updateSpectatorCount(me,tSpectatorCount,tSpectatorMax)
  createTimeout(pSpecCountTimerId, 15000, #getSpectatorCount, me.getID(), void(), 1)
  if tSpectatorCount = -1 then
    if windowExists(pSpecCountId) then
      removeWindow(pSpecCountId)
    end if
    return(1)
  end if
  tUnmerge = 1
  if not windowExists(pSpecCountId) then
    createWindow(pSpecCountId, "spec_count.window")
    tUnmerge = 0
  end if
  tText = getText("spectator_count")
  tTextImg = getWriter(pWriterBold).render(tText).duplicate()
  tTextWd = tTextImg.width
  tTextHt = tTextImg.height
  tText = replaceChunks(tText, "%cnt%", tSpectatorCount)
  tText = replaceChunks(tText, "%max%", tSpectatorMax)
  tTextImg = getWriter(pWriterBold).render(tText).duplicate()
  tWndObj = getWindow(pSpecCountId)
  if tWndObj = 0 then
    return(0)
  end if
  tWndObj.lock(1)
  if tUnmerge then
    tWndObj.unmerge()
  end if
  if not tWndObj.merge("spec_count_2.window") then
    return(0)
  end if
  tElem = tWndObj.getElement("spec_count_text")
  if tElem <> 0 then
    tElem.setText(tText)
    tElemWd = tElem.getProperty(#width)
    tWindowWd = tWndObj.getProperty(#width)
    tWindowHt = tWndObj.getProperty(#height)
    tWndObj.resizeTo(tTextWd + tWindowWd - tElemWd, tWindowHt)
    tElem.resizeTo(tTextWd, tElem.getProperty(#height))
    tElem.moveBy(tTextWd - tTextImg.width / 2, tWindowHt - tTextHt / 2)
    tElem.feedImage(tTextImg)
  end if
  tWndObj.center()
  tWndObj.moveTo(tWndObj.getProperty(#locX), 2)
  return(1)
  exit
end

5: showSpectatorView(me)
Lingo Code

on showSpectatorView(me)
  tRoomInt = getObject(#room_interface)
  if objectp(tRoomInt) then
    tRoomInt.hideInterface(#Remove)
    executeMessage(#removeObjectInfo)
    tRoomInt.showRoomBar()
    if tRoomInt.getHiliter() <> 0 then
      removeUpdate(tRoomInt.getHiliter().getID())
      removeObject(tRoomInt.getHiliter().getID())
    end if
  end if
  if visualizerExists(pVisualizerId) then
    return(1)
  end if
  createVisualizer(pVisualizerId, "habbo_tv.visual")
  tVisObj = getVisualizer(pVisualizerId)
  tRoomVis = tRoomInt.getRoomVisualizer()
  if tRoomVis = 0 then
    return(0)
  end if
  tVisObj.moveZ(getIntVariable("window.default.locz") - 10)
  return(1)
  exit
end

6: hideSpectatorView(me)
Lingo Code

on hideSpectatorView(me)
  pSpectatorMode = 0
  if visualizerExists(pVisualizerId) then
    removeVisualizer(pVisualizerId)
  end if
  if windowExists(pSpecCountId) then
    removeWindow(pSpecCountId)
  end if
  if timeoutExists(pSpecCountTimerId) then
    removeTimeout(pSpecCountTimerId)
  end if
  return(1)
  exit
end

7: getSpectatorCount(me)
Lingo Code

on getSpectatorCount(me)
  getConnection(getVariable("connection.room.id")).send("GET_SPECTATOR_AMOUNT")
  exit
end

Handlers
0: construct(me)
Lingo Code

on construct(me)
  pXOffset = 0
  pYOffset = 0
  pZOffset = 0
  pXFactor = 0
  pYFactor = 0
  pHFactor = 0
  pHeightMap = [[]]
  pPlaceMap = [[]]
  return(1)
  exit
end

1: define(me, tdata)
Lingo Code

on define(me,tdata)
  pXOffset = getLocalFloat(tdata.getAt(#offsetx))
  pYOffset = getLocalFloat(tdata.getAt(#offsety))
  pZOffset = getLocalFloat(tdata.getAt(#offsetz))
  pXFactor = getLocalFloat(tdata.getAt(#factorx))
  pYFactor = getLocalFloat(tdata.getAt(#factory))
  pHFactor = getLocalFloat(tdata.getAt(#factorh))
  return(1)
  exit
end

2: loadHeightMap(me, tdata)
Lingo Code

on loadHeightMap(me,tdata)
  pHeightMap = []
  pPlaceMap = []
  i = 1
  repeat while i <= tdata.count(#line)
    l = []
    k = []
    tLine = tdata.getProp(#line, i)
    if tLine <> "" then
      j = 1
      repeat while j <= length(tLine)
        if tLine.getProp(#char, j) = "x" then
          -- UNK_40 66
          -- UNK_2
          -- UNK_40 66
          -- UNK_2
        else
          if tLine.getProp(#char, j) = "y" then
            l.add(0)
            the undefined = ERROR
          else
            if charToNum(tLine.getProp(#char, j)) >= 65 and charToNum(tLine.getProp(#char, j)) < 73 then
              l.add(charToNum(tLine.getProp(#char, j)) - 65)
              the undefined = ERROR
            else
              l.add(integer(tLine.getProp(#char, j)))
              k.add(0)
            end if
          end if
        end if
        j = 1 + j
      end repeat
      pHeightMap.add(l)
      pPlaceMap.add(k)
    end if
    i = 1 + i
  end repeat
  return(1)
  exit
end

3: getScreenCoordinate(me, tLocX, tLocY, tHeight)
Lingo Code

on getScreenCoordinate(me,tLocX,tLocY,tHeight)
  tPrecision = the floatPrecision
  the floatPrecision = 2
  tLocH = tLocX - tLocY * pXFactor * 4128768 + pXOffset
  tLocV = float(tLocY + tLocX * pYFactor * 4128768 + pYOffset) - tHeight * pHFactor
  tlocz = 1000 * tLocX + tLocY + 1 + pZOffset
  the floatPrecision = tPrecision
  return([integer(tLocH), integer(tLocV), integer(tlocz)])
  exit
end

4: getCoordinateHeight(me, tX, tY)
Lingo Code

on getCoordinateHeight(me,tX,tY)
  tX = integer(tX)
  tY = integer(tY)
  if tY < 0 or tY >= pHeightMap.count then
    return(0)
  end if
  tLine = pHeightMap.getAt(integer(tY + 1))
  if tX < 0 or tX >= tLine.count then
    return(0)
  end if
  return(tLine.getAt(tX + 1))
  exit
end

5: getWorldCoordinate(me, tLocX, tLocY)
Lingo Code

on getWorldCoordinate(me,tLocX,tLocY)
  if voidp(pHeightMap) then
    return(void())
  end if
  tX = integer(tLocX - pYFactor - pXOffset / pXFactor + tLocY - pYOffset / pYFactor)
  tY = integer(tLocY - pYOffset / pYFactor - tLocX - pYFactor - pXOffset / pXFactor)
  tHeight = -1
  if tY >= 0 and tY < pHeightMap.count then
    if tX >= 0 and tX < pHeightMap.getAt(tY + 1).count then
      tHeight = pHeightMap.getAt(tY + 1).getAt(tX + 1)
    end if
  end if
  if tHeight = 0 then
    return([tX, tY, 0])
    exit repeat
  end if
  i = 1
  repeat while i <= 9
    tX = integer(tLocX - pYFactor - pXOffset / pXFactor + tLocY + i * pHFactor - pYOffset / pYFactor)
    tY = integer(tLocY + i * pHFactor - pYOffset / pYFactor - tLocX - pYFactor - pXOffset / pXFactor)
    tHeight = -1
    if tY >= 0 and tY < pHeightMap.count then
      if tX >= 0 and tX < pHeightMap.getAt(tY + 1).count then
        tHeight = pHeightMap.getAt(tY + 1).getAt(tX + 1)
      end if
    end if
    if tHeight = i then
      return([tX, tY, tHeight])
    end if
    i = 1 + i
  end repeat
  return(0)
  exit
end

6: getObjectPlaceMap(me)
Lingo Code

on getObjectPlaceMap(me)
  return(pPlaceMap)
  exit
end

7: getObjectHeightMap(me)
Lingo Code

on getObjectHeightMap(me)
  return(pHeightMap)
  exit
end

8: getTileHeight(me)
Lingo Code

on getTileHeight(me)
  return(pYFactor)
  exit
end

9: getTileWidth(me)
Lingo Code

on getTileWidth(me)
  return(pXFactor)
  exit
end

10: emptyTile(me, tX, tY)
Lingo Code

on emptyTile(me,tX,tY)
  if tY + 1 > 0 and tY + 1 <= count(pPlaceMap) then
    if tX + 1 > 0 and tX + 1 <= count(pPlaceMap.getAt(tY + 1)) then
      if pPlaceMap.getAt(tY + 1).getAt(tX + 1) > 1000 then
        return(0)
      end if
    else
      return(0)
    end if
  else
    return(0)
  end if
  return(1)
  exit
end

11: print(me)
Lingo Code

on print(me)
  put("- - - - - - - - - - - - - - -")
  put()
  put("X offset " & pXOffset)
  put("Y offset " & pYOffset)
  put("Z offset " & pZOffset)
  put("X factor " & pXFactor)
  put("Y factor " & pYFactor)
  put("H factor " & pHFactor)
  put()
  put("HeightMap:")
  put()
  x = 1
  repeat while x <= pHeightMap.count
    tStr = ""
    y = 1
    repeat while y <= pHeightMap.getAt(x).count
      the undefined = ERROR
      tStr = tStr & pHeightMap.getAt(x).getAt(y) & "."
      -- UNK_40 12
      if ERROR then
        tStr = tStr & "x" & "."
      else
        tStr = tStr & "." & "."
      end if
      y = 1 + y
    end repeat
    put(space() & space() & tStr & space())
    x = 1 + x
  end repeat
  put()
  put("PlaceMap:")
  put()
  x = 1
  repeat while x <= pPlaceMap.count
    tStr = ""
    y = 1
    repeat while y <= pPlaceMap.getAt(x).count
      the undefined = ERROR
      tStr = tStr & pPlaceMap.getAt(x).getAt(y) & "."
      -- UNK_40 12
      if ERROR then
        tStr = tStr & "x" & "."
      else
        tStr = tStr & "." & "."
      end if
      y = 1 + y
    end repeat
    put(space() & space() & tStr & space())
    x = 1 + x
  end repeat
  put()
  put("- - - - - - - - - - - - - - -")
  exit
end

Handlers
0: construct(me)
Lingo Code

on construct(me)
  pGeometry = void()
  pSprite = void()
  pLastLoc = point(0, 0)
  pLastCrd = void()
  return(1)
  exit
end

1: deconstruct(me)
Lingo Code

on deconstruct(me)
  pGeometry = void()
  if ilk(pSprite) = #sprite then
    pSprite.visible = 0
  end if
  pSprite = void()
  pLastLoc = void()
  return(1)
  exit
end

2: define(me, tdata)
Lingo Code

on define(me,tdata)
  pGeometry = getObject(tdata.getAt(#geometry))
  pSprite = tdata.getAt(#sprite)
  return(1)
  exit
end

3: update(me)
Lingo Code

on update(me)
  if the mouseLoc = pLastLoc then
    return()
  end if
  pLastLoc = the mouseLoc
  tCrd = pGeometry.getWorldCoordinate(the mouseH, the mouseV)
  if the optionDown then
    if pLastCrd <> tCrd then
      put(tCrd)
    end if
  end if
  pLastCrd = tCrd
  if not tCrd then
    pSprite.locH = -10000
    pSprite.locV = -10000
  else
    tScreenCoord = pGeometry.getScreenCoordinate(tCrd.getAt(1), tCrd.getAt(2), tCrd.getAt(3))
    pSprite.locH = tScreenCoord.getAt(1)
    pSprite.locV = tScreenCoord.getAt(2)
  end if
  exit
end

4: redirectEvent(me, tEvent, tSprID, tParam)
Lingo Code

on redirectEvent(me,tEvent,tSprID,tParam)
  pSprite.visible = 0
  call(tEvent, [sprite(the rollover)])
  pSprite.visible = 1
  exit
end

Handlers
0: construct(me)
Lingo Code

on construct(me)
  pRemoteControlledUsers = []
  return(me.regMsgList(1))
  exit
end

1: deconstruct(me)
Lingo Code

on deconstruct(me)
  pRemoteControlledUsers = []
  return(me.regMsgList(0))
  exit
end

2: handle_opc_ok(me, tMsg)
Lingo Code

on handle_opc_ok(me,tMsg)
  if me.getComponent().getRoomID() = "private" then
    me.getComponent().roomConnected(void(), "OPC_OK")
  end if
  exit
end

3: handle_clc(me)
Lingo Code

on handle_clc(me)
  me.getComponent().roomDisconnected()
  exit
end

4: handle_youaremod(me, tMsg)
Lingo Code

on handle_youaremod(me,tMsg)
  return(1)
  exit
end

5: handle_flat_letin(me, tMsg)
Lingo Code

on handle_flat_letin(me,tMsg)
  tConn = tMsg.connection
  tName = tConn.GetStrFrom()
  me.getInterface().showDoorBellAccepted(tName)
  if tName <> "" then
    return(1)
  end if
  return(me.getComponent().roomConnected(void(), "FLAT_LETIN"))
  exit
end

6: handle_room_ready(me, tMsg)
Lingo Code

on handle_room_ready(me,tMsg)
  me.getComponent().roomConnected(tMsg.getProp(#word, 1), "ROOM_READY")
  exit
end

7: handle_logout(me, tMsg)
Lingo Code

on handle_logout(me,tMsg)
  tuser = tMsg.getProp(#word, 1)
  if tuser <> getObject(#session).GET("user_index") then
    me.getComponent().removeUserObject(tuser)
  end if
  exit
end

8: handle_disconnect(me)
Lingo Code

on handle_disconnect(me)
  me.getComponent().roomDisconnected()
  exit
end

9: handle_error(me, tMsg)
Lingo Code

on handle_error(me,tMsg)
  tErr = tMsg.content
  error(me, tMsg.getID() & ":" && tErr, #handle_error, #dummy)
  if tErr = "info: No place for stuff" then
    me.getInterface().stopObjectMover()
  else
    if ERROR = "Incorrect flat password" then
      if threadExists(#navigator) then
        getThread(#navigator).getComponent().flatAccessResult(tErr)
      end if
    else
      if ERROR = "Password required" then
        if threadExists(#navigator) then
          getThread(#navigator).getComponent().flatAccessResult(tErr)
        end if
      else
        if ERROR = "weird error" then
          executeMessage(#leaveRoom)
        else
          if ERROR = "Not owner" then
            getObject(#session).set("room_controller", 0)
            me.getInterface().hideInterface(#hide)
          end if
        end if
      end if
    end if
  end if
  exit
end

10: handle_doorbell_ringing(me, tMsg)
Lingo Code

on handle_doorbell_ringing(me,tMsg)
  if tMsg.content = "" then
    return(me.getInterface().showDoorBellWaiting())
  else
    return(me.getInterface().showDoorBellDialog(tMsg.content))
  end if
  exit
end

11: handle_flatnotallowedtoenter(me, tMsg)
Lingo Code

on handle_flatnotallowedtoenter(me,tMsg)
  tConn = tMsg.connection
  tName = tConn.GetStrFrom()
  return(me.getInterface().showDoorBellRejected(tName))
  exit
end

12: handle_status(me, tMsg)
Lingo Code

on handle_status(me,tMsg)
  tList = []
  tCount = tMsg.count(#line)
  tDelim = the itemDelimiter
  the itemDelimiter = "/"
  i = 1
  repeat while i <= tCount
    tLine = tMsg.getProp(#line, i)
    if length(tLine) > 5 then
      tuser = []
      tuser.setAt(#id, tLine.getPropRef(#item, 1).getProp(#word, 1))
      tloc = tLine.getPropRef(#item, 1).getProp(#word, 2)
      the itemDelimiter = ","
      tuser.setAt(#x, integer(tloc.getProp(#item, 1)))
      tuser.setAt(#y, integer(tloc.getProp(#item, 2)))
      tuser.setAt(#h, getLocalFloat(tloc.getProp(#item, 3)))
      tuser.setAt(#dirHead, integer(tloc.getProp(#item, 4)) mod 8)
      tuser.setAt(#dirBody, integer(tloc.getProp(#item, 5)) mod 8)
      tActions = []
      the itemDelimiter = "/"
      j = 2
      repeat while j <= tLine.count(#item)
        if length(tLine.getProp(#item, j)) > 1 then
          tActions.add([#name:tLine.getPropRef(#item, j).getProp(#word, 1), #params:tLine.getProp(#item, j)])
        end if
        j = 1 + j
      end repeat
      tuser.setAt(#actions, tActions)
      tList.add(tuser)
    end if
    i = 1 + i
  end repeat
  the itemDelimiter = tDelim
  repeat while count(tList) <= 1
    tuser = getAt()
    if not pRemoteControlledUsers.getOne(tuser.getAt(#id)) > 0 then
      tUserObj = me.getComponent().getUserObject(tuser.getAt(#id))
      if tUserObj <> 0 then
        tUserObj.resetValues(tuser.getAt(#x), tuser.getAt(#y), tuser.getAt(#h), tuser.getAt(#dirHead), tuser.getAt(#dirBody))
        tPrimaryActions = ["mv", "sit", "lay"]
        tActionList = []
        i = tuser.getAt(#actions).count
        repeat while i >= 1
          tAction = tuser.getAt(#actions).getAt(i)
          if tPrimaryActions.findPos(tAction.getAt(#name)) then
            tActionList.add(tAction)
            tuser.getAt(#actions).deleteAt(i)
          end if
          i = 255 + i
        end repeat
        repeat while count(tuser.getAt(#actions)) <= 1
          tAction = getAt()
          tActionList.add(tAction)
        end repeat
        repeat while count(tActionList) <= 1
          tAction = getAt(ERROR + 1)
          call(symbol("action_" & tAction.getAt(#name)), [tUserObj], tAction.getAt(#params))
        end repeat
        tUserObj.Refresh(tuser.getAt(#x), tuser.getAt(#y), tuser.getAt(#h))
      end if
    end if
  end repeat
  exit
end

13: handle_users(me, tMsg)
Lingo Code

on handle_users(me,tMsg)
  tCount = tMsg.count(#line)
  tDelim = the itemDelimiter
  tList = []
  tuser = ""
  if not objectExists("Figure_System") then
    return(error(me, "Figure system object not found!", #handle_users, #major))
  end if
  f = 1
  repeat while f <= tCount
    tLine = tMsg.getProp(#line, f)
    tProp = tLine.getProp(#char, 1)
    tdata = tLine.getProp(#char, 3, length(tLine))
    if tProp = "i" then
      tuser = tdata
      tList.setAt(tuser, [])
      tList.getAt(tuser).setAt(#direction, [0, 0])
      tList.getAt(tuser).setAt(#id, tdata)
    else
      if ERROR = "n" then
        tList.getAt(tuser).setAt(#name, tdata)
        if tdata contains numToChar(4) then
          tList.getAt(tuser).setAt(#class, "pet")
        else
          tList.getAt(tuser).setAt(#class, "user")
        end if
      else
        if ERROR = "f" then
          tList.getAt(tuser).setAt(#figure, tdata)
        else
          if ERROR = "l" then
            tList.getAt(tuser).setAt(#x, integer(tdata.getProp(#word, 1)))
            tList.getAt(tuser).setAt(#y, integer(tdata.getProp(#word, 2)))
            tList.getAt(tuser).setAt(#h, getLocalFloat(tdata.getProp(#word, 3)))
          else
            if ERROR = "c" then
              tList.getAt(tuser).setAt(#custom, tdata)
            else
              if ERROR = "s" then
                if tdata.getProp(#char, 1) = "F" or tdata.getProp(#char, 1) = "f" then
                  tList.getAt(tuser).setAt(#sex, "F")
                else
                  tList.getAt(tuser).setAt(#sex, "M")
                end if
              else
                if ERROR = "p" then
                  if tdata contains "ch=s" then
                    the itemDelimiter = "/"
                    tmodel = tdata.getProp(#char, 4, 6)
                    tColor = tdata.getProp(#item, 2)
                    the itemDelimiter = ","
                    if tColor.count(#item) = 3 then
                      tColor = value("rgb(" & tColor & ")")
                    else
                      tColor = rgb("#EEEEEE")
                    end if
                    tList.getAt(tuser).setAt(#phfigure, ["model":tmodel, "color":tColor])
                    tList.getAt(tuser).setAt(#class, "pelle")
                  end if
                else
                  if ERROR = "b" then
                    tList.getAt(tuser).setAt(#badge, tdata)
                  else
                    if ERROR = "a" then
                      tList.getAt(tuser).setAt(#webID, tdata)
                    else
                      if ERROR = "g" then
                        tList.getAt(tuser).setAt(#groupID, tdata)
                      else
                        if ERROR = "t" then
                          tList.getAt(tuser).setAt(#groupstatus, tdata)
                        else
                          if tLine.getProp(#word, 1) = "[bot]" then
                            tList.getAt(tuser).setAt(#class, "bot")
                          end if
                        end if
                      end if
                    end if
                  end if
                end if
              end if
            end if
          end if
        end if
      end if
    end if
    f = 1 + f
  end repeat
  tFigureParser = getObject("Figure_System")
  repeat while count(tList) <= 1
    tObject = getAt()
    tObject.setAt(#figure, tFigureParser.parseFigure(tObject.getAt(#figure), tObject.getAt(#sex), tObject.getAt(#class)))
  end repeat
  the itemDelimiter = tDelim
  if count(tList) = 0 then
    me.getComponent().validateUserObjects(0)
  else
    tName = getObject(#session).GET(#userName)
    repeat while count(tList) <= 1
      tuser = getAt(ERROR + 1)
      if tuser.getAt(#name) = tName then
        getObject(#session).set("user_index", tuser.getAt(#id))
      end if
      me.getComponent().validateUserObjects(tuser)
      if me.getComponent().getPickedCryName() = tuser.getAt(#name) then
        me.getComponent().showCfhSenderDelayed(tuser.getAt(#id))
      end if
      if tuser.getAt(#name) = tName then
        me.getInterface().eventProcUserObj(#selection, tuser.getAt(#id), #userEnters)
        if not voidp(pHighlightUser) then
          me.getComponent().highlightUser(pHighlightUser)
          pHighlightUser = void()
        end if
      end if
    end repeat
  end if
  exit
end

14: handle_showprogram(me, tMsg)
Lingo Code

on handle_showprogram(me,tMsg)
  tLine = tMsg.content
  tDst = tLine.getProp(#word, 1)
  tCmd = tLine.getProp(#word, 2)
  tArg = tLine.getProp(#word, 3, tLine.count(#word))
  tdata = [#command:"SHOWPROGRAM", #show_dest:tDst, #show_command:tCmd, #show_params:tArg]
  tObj = me.getComponent().getRoomPrg()
  if objectp(tObj) then
    call(#showprogram, [tObj], tdata)
  end if
  exit
end

15: handle_no_user_for_gift(me, tMsg)
Lingo Code

on handle_no_user_for_gift(me,tMsg)
  tUserName = tMsg.content
  tAlertString = getText("no_user_for_gift")
  tAlertString = replaceChunks(tAlertString, "%user%", tUserName)
  executeMessage(#alert, [#Msg:tAlertString])
  exit
end

16: handle_heightmap(me, tMsg)
Lingo Code

on handle_heightmap(me,tMsg)
  me.getComponent().validateHeightMap(tMsg.content)
  exit
end

17: handle_heightmapupdate(me, tMsg)
Lingo Code

on handle_heightmapupdate(me,tMsg)
  me.getComponent().updateHeightMap(tMsg.content)
  exit
end

18: handle_OBJECTS(me, tMsg)
Lingo Code

on handle_OBJECTS(me,tMsg)
  tList = []
  tCount = tMsg.count(#line)
  i = 1
  repeat while i <= tCount
    tLine = tMsg.getProp(#line, i)
    if length(tLine) > 5 then
      tObj = []
      tObj.setAt(#id, tLine.getProp(#word, 1))
      tObj.setAt(#class, tLine.getProp(#word, 2))
      tObj.setAt(#x, integer(tLine.getProp(#word, 3)))
      tObj.setAt(#y, integer(tLine.getProp(#word, 4)))
      tObj.setAt(#h, integer(tLine.getProp(#word, 5)))
      if tLine.count(#word) = 6 then
        tdir = integer(tLine.getProp(#word, 6)) mod 8
        tObj.setAt(#direction, [tdir, tdir, tdir])
        tObj.setAt(#dimensions, 0)
      else
        tWidth = integer(tLine.getProp(#word, 6))
        tHeight = integer(tLine.getProp(#word, 7))
        tObj.setAt(#dimensions, [tWidth, tHeight])
        tObj.setAt(#x, tObj.getAt(#x) + tObj.getAt(#width) - 1)
        tObj.setAt(#y, tObj.getAt(#y) + tObj.getAt(#height) - 1)
      end if
      if tObj.getAt(#id) <> "" then
        tList.add(tObj)
      end if
    end if
    i = 1 + i
  end repeat
  if count(tList) > 0 then
    repeat while count(tList) <= 1
      tObj = getAt()
      me.getComponent().validatePassiveObjects(tObj)
    end repeat
  else
    me.getComponent().validatePassiveObjects(0)
  end if
  exit
end

19: parseActiveObject(me, tConn)
Lingo Code

on parseActiveObject(me,tConn)
  if not tConn then
    return(0)
  end if
  tObj = []
  tObj.setAt(#id, tConn.GetStrFrom())
  tObj.setAt(#class, tConn.GetStrFrom())
  tObj.setAt(#x, tConn.GetIntFrom())
  tObj.setAt(#y, tConn.GetIntFrom())
  tWidth = tConn.GetIntFrom()
  tHeight = tConn.GetIntFrom()
  tDirection = tConn.GetIntFrom() mod 8
  tObj.setAt(#direction, [tDirection, tDirection, tDirection])
  tObj.setAt(#dimensions, [tWidth, tHeight])
  tObj.setAt(#altitude, getLocalFloat(tConn.GetStrFrom()))
  tObj.setAt(#colors, tConn.GetStrFrom())
  if tObj.getAt(#colors) = "" then
    tObj.setAt(#colors, "0")
  end if
  tRuntimeData = tConn.GetStrFrom()
  tExtra = tConn.GetIntFrom()
  tStuffData = tConn.GetStrFrom()
  tObj.setAt(#props, [#runtimedata:tRuntimeData, #extra:tExtra, #stuffdata:tStuffData])
  return(tObj)
  exit
end

20: handle_activeobjects(me, tMsg)
Lingo Code

on handle_activeobjects(me,tMsg)
  tConn = tMsg.connection
  if not tConn then
    return(0)
  end if
  tList = []
  tCount = tConn.GetIntFrom()
  i = 1
  repeat while i <= tCount
    if tConn <> 0 then
      tObj = me.parseActiveObject(tConn)
      if listp(tObj) then
        tList.add(tObj)
      end if
    end if
    i = 1 + i
  end repeat
  if count(tList) > 0 then
    repeat while count(tList) <= 1
      tObj = getAt()
      me.getComponent().validateActiveObjects(tObj)
    end repeat
    executeMessage(#activeObjectsUpdated)
  else
    me.getComponent().validateActiveObjects(0)
  end if
  exit
end

21: handle_activeobject_remove(me, tMsg)
Lingo Code

on handle_activeobject_remove(me,tMsg)
  me.getComponent().removeActiveObject(tMsg.getProp(#word, 1))
  executeMessage(#activeObjectRemoved)
  return(1)
  exit
end

22: handle_activeobject_add(me, tMsg)
Lingo Code

on handle_activeobject_add(me,tMsg)
  tConn = tMsg.connection
  if not tConn then
    return(0)
  end if
  tObj = me.parseActiveObject(tConn)
  if not listp(tObj) then
    return(0)
  end if
  me.getComponent().validateActiveObjects(tObj)
  executeMessage(#activeObjectsUpdated)
  return(1)
  exit
end

23: handle_activeobject_update(me, tMsg)
Lingo Code

on handle_activeobject_update(me,tMsg)
  tConn = tMsg.connection
  if not tConn then
    return(0)
  end if
  tObj = me.parseActiveObject(tConn)
  if not listp(tObj) then
    return(0)
  end if
  tComponent = me.getComponent()
  if tComponent.activeObjectExists(tObj.getAt(#id)) then
    tObj = getThread(#buffer).getComponent().processObject(tObj, "active")
    tActiveObj = tComponent.getActiveObject(tObj.getAt(#id))
    tActiveObj.define(tObj)
    tComponent.removeSlideObject(tObj.getAt(#id))
    call(#movingFinished, [tActiveObj])
    executeMessage(#activeObjectsUpdated)
  else
    return(error(me, "Active object not found:" && tObj.getAt(#id), #handle_activeobject_update, #major))
  end if
  exit
end

24: handle_items(me, tMsg)
Lingo Code

on handle_items(me,tMsg)
  tList = []
  tDelim = the itemDelimiter
  i = 1
  repeat while i <= tMsg.count(#line)
    the itemDelimiter = "\t"
    tLine = tMsg.getProp(#line, i)
    if tLine <> "" then
      tObj = []
      tObj.setAt(#id, tLine.getProp(#item, 1))
      tObj.setAt(#class, tLine.getProp(#item, 2))
      tObj.setAt(#owner, tLine.getProp(#item, 3))
      tObj.setAt(#type, tLine.getProp(#item, 5))
      if not tLine.getPropRef(#item, 4).getProp(#char, 1) = ":" then
        tObj.setAt(#direction, tLine.getPropRef(#item, 4).getProp(#word, 1))
        if tObj.getAt(#direction) = "frontwall" then
          tObj.setAt(#direction, "rightwall")
        end if
        tlocation = tLine.getPropRef(#item, 4).getProp(#word, 2, tLine.getPropRef(#item, 4).count(#word))
        the itemDelimiter = ","
        tObj.setAt(#x, 0)
        tObj.setAt(#y, tlocation.getProp(#item, 1))
        tObj.setAt(#h, getLocalFloat(tlocation.getProp(#item, 2)))
        tObj.setAt(#z, integer(tlocation.getProp(#item, 3)))
        tObj.setAt(#formatVersion, #old)
      else
        tLocString = tLine.getProp(#item, 4)
        tWallLoc = tLocString.getPropRef(#word, 1).getProp(#char, 4, length(tLocString.getProp(#word, 1)))
        the itemDelimiter = ","
        tObj.setAt(#wall_x, value(tWallLoc.getProp(#item, 1)))
        tObj.setAt(#wall_y, value(tWallLoc.getProp(#item, 2)))
        tLocalLoc = tLocString.getPropRef(#word, 2).getProp(#char, 3, length(tLocString.getProp(#word, 2)))
        tObj.setAt(#local_x, value(tLocalLoc.getProp(#item, 1)))
        tObj.setAt(#local_y, value(tLocalLoc.getProp(#item, 2)))
        tDirChar = tLocString.getProp(#word, 3)
        if tDirChar = "r" then
          tObj.setAt(#direction, "rightwall")
        else
          if ERROR = "l" then
            tObj.setAt(#direction, "leftwall")
          end if
        end if
        tObj.setAt(#formatVersion, #new)
      end if
      tList.add(tObj)
    end if
    i = 1 + i
  end repeat
  the itemDelimiter = tDelim
  if count(tList) > 0 then
    repeat while count(tList) <= 1
      tItem = getAt()
      me.getComponent().validateItemObjects(tItem)
    end repeat
    executeMessage(#itemObjectsUpdated)
  else
    me.getComponent().validateItemObjects(0)
  end if
  exit
end

25: handle_removeitem(me, tMsg)
Lingo Code

on handle_removeitem(me,tMsg)
  me.getComponent().removeItemObject(tMsg.content)
  executeMessage(#itemObjectRemoved)
  me.getInterface().stopObjectMover()
  exit
end

26: handle_updateitem(me, tMsg)
Lingo Code

on handle_updateitem(me,tMsg)
  tItem = me.getComponent().getItemObject(tMsg.getProp(#word, 1))
  if objectp(tItem) then
    tItem.setState(the last word in undefined)
  end if
  exit
end

27: handle_stuffdataupdate(me, tMsg)
Lingo Code

on handle_stuffdataupdate(me,tMsg)
  tConn = tMsg.connection
  if not tConn then
    return(0)
  end if
  tTarget = tConn.GetStrFrom()
  tValue = tConn.GetStrFrom()
  if me.getComponent().activeObjectExists(tTarget) then
    call(#updateStuffdata, [me.getComponent().getActiveObject(tTarget)], tValue)
  else
    return(error(me, "Active object not found:" && tTarget, #handle_stuffdataupdate, #major))
  end if
  exit
end

28: handle_presentopen(me, tMsg)
Lingo Code

on handle_presentopen(me,tMsg)
  ttype = tMsg.getProp(#line, 1)
  tCode = tMsg.getProp(#line, 2)
  tColors = tMsg.getProp(#line, 3)
  tCard = "PackageCardObj"
  if objectExists(tCard) then
    getObject(tCard).showContent([#type:ttype, #code:tCode, #color:tColors])
  else
    error(me, "Package card obj not found!", #handle_presentopen, #major)
  end if
  exit
end

29: handle_flatproperty(me, tMsg)
Lingo Code

on handle_flatproperty(me,tMsg)
  tDelim = the itemDelimiter
  the itemDelimiter = "/"
  tLine = tMsg.content
  tdata = [#key:tLine.getProp(#item, 1), #value:tLine.getProp(#item, 2)]
  the itemDelimiter = tDelim
  tRoomPrg = me.getComponent().getRoomPrg()
  if tRoomPrg <> 0 then
    tRoomPrg.setProperty(tdata.getAt(#key), tdata.getAt(#value))
  else
    error(me, "Private room program not found!", #handle_flatproperty, #major)
  end if
  exit
end

30: handle_room_rights(me, tMsg)
Lingo Code

on handle_room_rights(me,tMsg)
  if tMsg.subject = 42 then
    getObject(#session).set("room_controller", 1)
  else
    if ERROR = 43 then
      getObject(#session).set("room_controller", 0)
    else
      if ERROR = 47 then
        getObject(#session).set("room_owner", 1)
      end if
    end if
  end if
  exit
end

31: handle_stripinfo(me, tMsg)
Lingo Code

on handle_stripinfo(me,tMsg)
  tProps = [#objects:[], #count:0]
  tDelim = the itemDelimiter
  tProps.setAt(#count, integer(tMsg.getProp(#line, tMsg.count(#line))))
  the itemDelimiter = "/"
  tCount = tMsg.count(#item)
  tStripMax = 0
  tTotalItemCount = 0
  i = 1
  repeat while i <= tCount
    the itemDelimiter = "/"
    tItem = tMsg.getProp(#item, i)
    if tItem = "" then
      exit repeat
    end if
    the itemDelimiter = numToChar(30)
    if tItem.count(#item) < 2 then
      tTotalItemCount = integer(tItem - 1)
      exit repeat
    end if
    tObj = []
    tObj.setAt(#stripId, tItem.getProp(#item, 2))
    tObjectPos = integer(tItem.getProp(#item, 3))
    tObj.setAt(#striptype, tItem.getProp(#item, 4))
    tObj.setAt(#id, tItem.getProp(#item, 5))
    tObj.setAt(#class, tItem.getProp(#item, 6))
    if tObj.getAt(#striptype) = "S" then
      tObj.setAt(#name, getText("furni_" & tObj.getAt(#class) & "_name", "furni_" & tObj.getAt(#class) & "_name"))
      tObj.setAt(#striptype, "active")
      tObj.setAt(#custom, getText("furni_" & tObj.getAt(#class) & "_name", "furni_" & tObj.getAt(#class) & "_desc"))
      tObj.setAt(#dimensions, [integer(tItem.getProp(#item, 7)), integer(tItem.getProp(#item, 8))])
      tObj.setAt(#stuffdata, tItem.getProp(#item, 9))
      tObj.setAt(#colors, tItem.getProp(#item, 10))
      tObj.setAt(#isRecyclable, tItem.getProp(#item, 11))
      if tItem.getProp(#item, 12) <> "" and tItem.count(#item) >= 12 then
        tObj.setAt(#slotID, tItem.getProp(#item, 12))
      end if
      if tItem.getProp(#item, 13) <> "" and tItem.count(#item) >= 13 then
        tObj.setAt(#songID, tItem.getProp(#item, 13))
      end if
      the itemDelimiter = ","
      if tObj.getAt(#colors).getProp(#char, 1) = "#" then
        if tObj.getAt(#colors).count(#item) > 1 then
          tObj.setAt(#stripColor, rgb(tObj.getAt(#colors).getProp(#item, tObj.getAt(#colors).count(#item))))
        else
          tObj.setAt(#stripColor, rgb(tObj.getAt(#colors)))
        end if
      else
        tObj.setAt(#stripColor, 0)
      end if
    else
      if ERROR = "I" then
        tObj.setAt(#striptype, "item")
        tObj.setAt(#props, tItem.getProp(#item, 7))
        tObj.setAt(#isRecyclable, tItem.getProp(#item, 8))
        if tObj.getAt(#class) = "poster" then
          tObj.setAt(#name, getText("poster_" & tObj.getAt(#props) & "_name", "poster_" & tObj.getAt(#props) & "_name"))
        else
          tObj.setAt(#name, getText("wallitem_" & tObj.getAt(#class) & "_name", "wallitem_" & tObj.getAt(#class) & "_name"))
        end if
      end if
    end if
    tProps.getAt(#objects).add(tObj)
    if tObjectPos > tStripMax then
      tStripMax = tObjectPos
    end if
    i = 1 + i
  end repeat
  the itemDelimiter = tDelim
  tInventory = me.getInterface().getContainer()
  tInventory.setHandButton("next", tTotalItemCount > integer(tStripMax))
  tInventory.setHandButton("prev", integer(tStripMax) > 8)
  if tMsg.subject = 140 then
    tInventory.updateStripItems(tProps.getAt(#objects))
    tInventory.setStripItemCount(tProps.getAt(#count))
    tInventory.open(1)
    tInventory.Refresh()
  else
    if ERROR = 98 then
      tInventory.appendStripItem(tProps.getAt(#objects).getAt(1))
      tInventory.open(1)
      tInventory.Refresh()
    else
      if ERROR = 108 then
        return(tProps)
      end if
    end if
  end if
  exit
end

32: handle_stripupdated(me, tMsg)
Lingo Code

on handle_stripupdated(me,tMsg)
  tMsg.send("GETSTRIP", "new")
  exit
end

33: handle_removestripitem(me, tMsg)
Lingo Code

on handle_removestripitem(me,tMsg)
  me.getInterface().getContainer().removeStripItem(tMsg.getProp(#word, 1))
  me.getInterface().getContainer().Refresh()
  exit
end

34: handle_youarenotallowed(me)
Lingo Code

on handle_youarenotallowed(me)
  executeMessage(#alert, [#Msg:"trade_youarenotallowed", #id:"youarenotallowed"])
  exit
end

35: handle_othernotallowed(me)
Lingo Code

on handle_othernotallowed(me)
  executeMessage(#alert, [#Msg:"trade_othernotallowed", #id:"othernotallowed"])
  exit
end

36: handle_idata(me, tMsg)
Lingo Code

on handle_idata(me,tMsg)
  tDelim = the itemDelimiter
  the itemDelimiter = "\t"
  tID = integer(tMsg.getPropRef(#line, 1).getProp(#item, 1))
  ttype = tMsg.getPropRef(#line, 1).getProp(#item, 2)
  tText = tMsg.getPropRef(#line, 1).getProp(#item, 2) & "\r" & tMsg.getProp(#line, 2, tMsg.count(#line))
  the itemDelimiter = tDelim
  executeMessage(symbol("itemdata_received" & tID), [#id:tID, #text:tText, #type:ttype])
  exit
end

37: handle_trade_items(me, tMsg)
Lingo Code

on handle_trade_items(me,tMsg)
  tMessage = []
  i = 1
  repeat while i <= 2
    tLine = tMsg.getProp(#line, i)
    tdata = []
    tdata.setAt(#accept, tLine.getProp(#word, 2))
    tItemStr = "foo" & "\r" & tLine.getProp(#word, 3, tLine.count(#word)) & "\r" & 1
    tdata.setAt(#items, me.handle_stripinfo([#subject:108, #content:tItemStr]).getaProp(#objects))
    if not listp(tdata.getAt(#items)) then
      return(error(me, "Invalid itemdata from server!", #handle_trade_items, #major))
    end if
    tUserName = tLine.getProp(#word, 1)
    if tUserName = "" then
      return(error(me, "No username from server", #handle_trade_items, #major))
    end if
    if me.getInterface().getIgnoreStatus(void(), tUserName) then
      return(me.getComponent().getRoomConnection().send("TRADE_CLOSE"))
    end if
    tMessage.setAt(tUserName, tdata)
    i = 1 + i
  end repeat
  return(me.getInterface().getSafeTrader().Refresh(tMessage))
  exit
end

38: handle_trade_close(me, tMsg)
Lingo Code

on handle_trade_close(me,tMsg)
  me.getInterface().getSafeTrader().close()
  tMsg.send("GETSTRIP", "new")
  exit
end

39: handle_trade_accept(me, tMsg)
Lingo Code

on handle_trade_accept(me,tMsg)
  tDelim = the itemDelimiter
  the itemDelimiter = "/"
  tuser = tMsg.getProp(#item, 1)
  tValue = tMsg.getProp(#item, 2) = "true"
  the itemDelimiter = tDelim
  me.getInterface().getSafeTrader().accept(tuser, tValue)
  exit
end

40: handle_trade_completed(me, tMsg)
Lingo Code

on handle_trade_completed(me,tMsg)
  me.getInterface().getSafeTrader().complete()
  exit
end

41: handle_door_in(me, tMsg)
Lingo Code

on handle_door_in(me,tMsg)
  tDelim = the itemDelimiter
  the itemDelimiter = "/"
  tDoor = tMsg.getProp(#item, 1)
  tuser = tMsg.getProp(#item, 2)
  the itemDelimiter = tDelim
  tDoorObj = me.getComponent().getActiveObject(tDoor)
  if tDoorObj <> 0 then
    call(#animate, [tDoorObj], 18)
    if getObject(#session).GET("user_name") = tuser then
      call(#prepareToKick, [tDoorObj], tuser)
    end if
  end if
  exit
end

42: handle_door_out(me, tMsg)
Lingo Code

on handle_door_out(me,tMsg)
  tDelim = the itemDelimiter
  the itemDelimiter = "/"
  tDoor = me.getComponent().getActiveObject(tMsg.getProp(#item, 1))
  the itemDelimiter = tDelim
  if tDoor <> 0 then
    call(#animate, [tDoor])
  end if
  exit
end

43: handle_doorflat(me, tMsg)
Lingo Code

on handle_doorflat(me,tMsg)
  tConn = tMsg.connection
  tTeleId = tConn.GetIntFrom()
  tFlatID = tConn.GetIntFrom()
  if not tTeleId and tFlatID then
    return(error(me, "Retarded doorflat data!", #handle_doorflat, #major))
  end if
  me.getComponent().startTeleport(tTeleId, tFlatID)
  exit
end

44: handle_doordeleted(me, tMsg)
Lingo Code

on handle_doordeleted(me,tMsg)
  if getObject(#session).exists("current_door_ID") then
    tDoorID = getObject(#session).GET("current_door_ID")
    tDoorObj = me.getComponent().getActiveObject(tDoorID)
    if tDoorObj <> 0 then
      tDoorObj.kickOut()
    end if
  end if
  exit
end

45: handle_dice_value(me, tMsg)
Lingo Code

on handle_dice_value(me,tMsg)
  tID = tMsg.getProp(#word, 1)
  if tMsg.count(#word) = 1 then
    tValue = -1
  else
    tValue = integer(tMsg.getProp(#word, 2) - tID * 38)
    if tValue > 6 then
      tValue = 0
    end if
  end if
  if me.getComponent().activeObjectExists(tID) then
    call(#diceThrown, [me.getComponent().getActiveObject(tID)], tValue)
  end if
  exit
end

46: handle_roomad(me, tMsg)
Lingo Code

on handle_roomad(me,tMsg)
  if tMsg.length > 1 then
    tDelim = the itemDelimiter
    the itemDelimiter = "\t"
    tSourceURL = tMsg.getProp(#item, 1)
    tTargetURL = tMsg.getProp(#item, 2)
    the itemDelimiter = tDelim
    tLayoutID = me.getInterface().getRoomVisualizer().pLayout
    me.getComponent().getAd().Init(tSourceURL, tTargetURL, tLayoutID)
  else
    me.getComponent().getAd().Init(0)
  end if
  exit
end

47: handle_petstat(me, tMsg)
Lingo Code

on handle_petstat(me,tMsg)
  tPetObj = me.getComponent().getUserObject(tMsg.GetIntFrom())
  if tPetObj = 0 then
    return(error(me, "Pet object not found!", #handle_petstat, #major))
  end if
  tName = tPetObj.getName()
  tAge = tMsg.GetIntFrom()
  tHungry = getText("pet_hung_" & tMsg.GetIntFrom(), "???")
  tThirsty = getText("pet_thir_" & tMsg.GetIntFrom(), "???")
  tHappiness = getText("pet_mood_" & tMsg.GetIntFrom(), "???")
  tNature01 = getText("pet_enrg_" & tMsg.GetIntFrom(), "???")
  tNature02 = getText("pet_frnd_" & tMsg.GetIntFrom(), "???")
  if createWindow("pet_status_dialog") then
    tWndObj = getWindow("pet_status_dialog")
    tWndObj.moveTo(8, 8)
    tWndObj.setProperty(#title, tName)
    if not tWndObj.merge("habbo_full.window") then
      return(tWndObj.close())
    end if
    if not tWndObj.merge("petstatus.window") then
      return(tWndObj.close())
    end if
    tWndObj.getElement("age").setText(tAge)
    tWndObj.getElement("hungry").setText(tHungry)
    tWndObj.getElement("thirsty").setText(tThirsty)
    tWndObj.getElement("happiness").setText(tHappiness)
    tWndObj.getElement("nature").setText(tNature01 & "," && tNature02)
    tWndObj.getElement("picture").feedImage(tPetObj.getPicture())
    registerMessage(#leaveRoom, tWndObj.getID(), #close)
    registerMessage(#changeRoom, tWndObj.getID(), #close)
  end if
  exit
end

48: handle_userbadge(me, tMsg)
Lingo Code

on handle_userbadge(me,tMsg)
  if voidp(tMsg.connection) then
    return(0)
  end if
  tUserID = string(tMsg.GetIntFrom())
  tBadge = tMsg.GetStrFrom()
  tUserObj = me.getComponent().getUserObject(tUserID)
  if not objectp(tUserObj) then
    return(0)
  end if
  tUserObj.pBadge = tBadge
  me.getInterface().unignoreAdmin(tUserID, tBadge)
  executeMessage(#updateInfoStandBadge, tBadge, tUserID)
  exit
end

49: handle_slideobjectbundle(me, tMsg)
Lingo Code

on handle_slideobjectbundle(me,tMsg)
  tConn = tMsg.getaProp(#connection)
  tComponent = me.getComponent()
  tTimeNow = the milliSeconds
  tObjList = []
  tContainsObjects = 0
  tFromX = tConn.GetIntFrom()
  tFromY = tConn.GetIntFrom()
  tToX = tConn.GetIntFrom()
  tToY = tConn.GetIntFrom()
  tStuffCount = tConn.GetIntFrom()
  tCount = 1
  repeat while tCount <= tStuffCount
    tObj = []
    tItemID = tConn.GetIntFrom()
    tItemFromH = getLocalFloat(tConn.GetStrFrom())
    tItemToH = getLocalFloat(tConn.GetStrFrom())
    tFrom = [tFromX, tFromY, tItemFromH]
    tTo = [tToX, tToY, tItemToH]
    tObj = [tItemID, tFrom, tTo]
    tObjList.add(tObj)
    tContainsObjects = 1
    tCount = 1 + tCount
  end repeat
  tTileID = tConn.GetIntFrom()
  tTileObj = tComponent.getActiveObject(tTileID)
  if tTileObj <> 0 then
    if tTileObj.handler(#setAnimation) then
      call(#setAnimation, tTileObj, 1)
    end if
  end if
  tMoveType = tConn.GetIntFrom()
  if tMoveType = 0 then
    tHasCharacter = 0
  else
    if ERROR = 1 then
      tMoveType = "mv"
      tHasCharacter = 1
    else
      if ERROR = 2 then
        tMoveType = "sld"
        tHasCharacter = 1
      else
        return(error(me, "Incompatible character movetype", #handle_slideobjectbundle, #minor))
      end if
    end if
  end if
  if tHasCharacter then
    tCharID = tConn.GetIntFrom()
    tFromH = getLocalFloat(tConn.GetStrFrom())
    tToH = getLocalFloat(tConn.GetStrFrom())
    tUserObj = me.getComponent().getUserObject(tCharID)
    if tUserObj <> 0 then
      tCommandStr = tMoveType && tToX & "," & tToY & "," & tToH && tContainsObjects.integer && tTimeNow
      call(symbol("action_" & tMoveType), [tUserObj], tCommandStr)
    end if
  end if
  repeat while count(tObjList) <= 1
    tObj = getAt()
    tComponent.addSlideObject(tObj.getAt(1), tObj.getAt(2), tObj.getAt(3), tTimeNow, tHasCharacter)
  end repeat
  exit
end

50: handle_interstitialdata(me, tMsg)
Lingo Code

on handle_interstitialdata(me,tMsg)
  if tMsg.length > 1 then
    tDelim = the itemDelimiter
    the itemDelimiter = "\t"
    tSourceURL = tMsg.getProp(#item, 1)
    tTargetURL = tMsg.getProp(#item, 2)
    the itemDelimiter = tDelim
    me.getComponent().getInterstitial().Init(tSourceURL, tTargetURL)
  else
    me.getComponent().getInterstitial().Init(0)
  end if
  exit
end

51: handle_roomqueuedata(me, tMsg)
Lingo Code

on handle_roomqueuedata(me,tMsg)
  tConn = tMsg.getaProp(#connection)
  tSetCount = tConn.GetIntFrom()
  tQueueCollection = []
  i = 1
  repeat while i <= tSetCount
    tQueueSetName = tConn.GetStrFrom()
    tQueueTarget = tConn.GetIntFrom()
    tNumberOfQueues = tConn.GetIntFrom()
    tQueueData = []
    tQueueSet = []
    t = 1
    repeat while t <= tNumberOfQueues
      tQueueID = tConn.GetStrFrom()
      tQueueLength = tConn.GetIntFrom()
      tQueueData.setAt(tQueueID, tQueueLength)
      t = 1 + t
    end repeat
    tQueueSet.setAt("name", tQueueSetName)
    tQueueSet.setAt("target", tQueueTarget)
    tQueueSet.setAt("data", tQueueData)
    tQueueCollection.setAt(i, tQueueSet)
    i = 1 + i
  end repeat
  me.getInterface().updateQueueWindow(tQueueCollection)
  exit
end

52: handle_youarespectator(me)
Lingo Code

on handle_youarespectator(me)
  return(me.getComponent().setSpectatorMode(1))
  exit
end

53: handle_removespecs(me)
Lingo Code

on handle_removespecs(me)
  me.getInterface().showRemoveSpecsNotice()
  exit
end

54: handle_figure_change(me, tMsg)
Lingo Code

on handle_figure_change(me,tMsg)
  tConn = tMsg.connection
  tUserID = tConn.GetIntFrom()
  tUserFigure = tConn.GetStrFrom()
  tUserSex = tConn.GetStrFrom()
  tUserCustomInfo = tConn.GetStrFrom()
  me.getComponent().updateCharacterFigure(tUserID, tUserFigure, tUserSex, tUserCustomInfo)
  exit
end

55: handle_spectator_amount(me, tMsg)
Lingo Code

on handle_spectator_amount(me,tMsg)
  tConn = tMsg.connection
  tSpecCount = tConn.GetIntFrom()
  tSpecMax = tConn.GetIntFrom()
  me.getComponent().updateSpectatorCount(tSpecCount, tSpecMax)
  exit
end

56: handle_group_badges(me, tMsg)
Lingo Code

on handle_group_badges(me,tMsg)
  tConn = tMsg.connection
  tNumberOfGroups = tConn.GetIntFrom()
  tGroupData = []
  tNo = 1
  repeat while tNo <= tNumberOfGroups
    tGroup = []
    tGroup.setAt(#id, tConn.GetIntFrom())
    tGroup.setAt(#logo, tConn.GetStrFrom())
    tGroupData.add(tGroup)
    tNo = 1 + tNo
  end repeat
  me.getComponent().getGroupInfoObject().updateGroupInformation(tGroupData)
  exit
end

57: handle_group_details(me, tMsg)
Lingo Code

on handle_group_details(me,tMsg)
  tConn = tMsg.connection
  tGroupData = []
  tGroup = []
  tGroup.setAt(#id, tConn.GetIntFrom())
  if tGroup.getAt(#id) = -1 then
    return(0)
  end if
  tGroup.setAt(#name, tConn.GetStrFrom())
  tGroup.setAt(#desc, tConn.GetStrFrom())
  tGroup.setAt(#roomid, tConn.GetIntFrom())
  tGroup.setAt(#roomname, tConn.GetStrFrom())
  tGroupData.add(tGroup)
  me.getComponent().getGroupInfoObject().updateGroupInformation(tGroupData)
  executeMessage(#groupInfoRetrieved, tGroup.getAt(#id))
  exit
end

58: handle_group_membership_update(me, tMsg)
Lingo Code

on handle_group_membership_update(me,tMsg)
  tConn = tMsg.connection
  tUserIndex = tConn.GetIntFrom()
  tGroupId = tConn.GetIntFrom()
  tStatus = tConn.GetIntFrom()
  tuser = me.getComponent().getUserObject(tUserIndex)
  if not voidp(tuser) then
    if tuser <> 0 then
      tuser.setProperty(#groupID, tGroupId)
      tuser.setProperty(#groupstatus, tStatus)
    end if
  end if
  exit
end

59: handle_room_rating(me, tMsg)
Lingo Code

on handle_room_rating(me,tMsg)
  tConn = tMsg.connection
  tRoomRating = tConn.GetIntFrom()
  tRoomRatingPercent = tConn.GetIntFrom()
  me.getComponent().setRoomRating(tRoomRating, tRoomRatingPercent)
  executeMessage(#roomRatingChanged)
  exit
end

60: handle_user_tag_list(me, tMsg)
Lingo Code

on handle_user_tag_list(me,tMsg)
  tConn = tMsg.connection
  tUserID = tConn.GetIntFrom()
  tNumOfTags = tConn.GetIntFrom()
  tTagList = []
  tTagNum = 1
  repeat while tTagNum <= tNumOfTags
    tTag = tConn.GetStrFrom()
    tTagList.add(tTag)
    tTagNum = 1 + tTagNum
  end repeat
  executeMessage(#updateUserTags, tUserID, tTagList)
  exit
end

61: handle_user_typing_status(me, tMsg)
Lingo Code

on handle_user_typing_status(me,tMsg)
  tConn = tMsg.connection
  tUserID = tConn.GetIntFrom()
  tstate = tConn.GetIntFrom()
  tUserID = string(tUserID)
  me.getComponent().setUserTypingStatus(tUserID, tstate)
  exit
end

62: handle_highlight_user(me, tMsg)
Lingo Code

on handle_highlight_user(me,tMsg)
  tConn = tMsg.getaProp(#connection)
  tUserID = tConn.GetStrFrom()
  pHighlightUser = tUserID
  exit
end

63: handle_roomevent_permission(me, tMsg)
Lingo Code

on handle_roomevent_permission(me,tMsg)
  tConn = tMsg.getaProp(#connection)
  tCanCreate = tConn.GetIntFrom()
  if tCanCreate then
    executeMessage(#allowRoomeventCreation)
  end if
  exit
end

64: handle_roomevent_types(me, tMsg)
Lingo Code

on handle_roomevent_types(me,tMsg)
  tConn = tMsg.getaProp(#connection)
  tTypeCount = tConn.GetIntFrom()
  me.getComponent().setRoomEventTypeCount(tTypeCount)
  exit
end

65: handle_roomevent_list(me, tMsg)
Lingo Code

on handle_roomevent_list(me,tMsg)
  tConn = tMsg.getaProp(#connection)
  tTypeID = tConn.GetIntFrom()
  tEventCount = tConn.GetIntFrom()
  tEvents = []
  tEventNum = 1
  repeat while tEventNum <= tEventCount
    tEvent = []
    tEvent.setaProp(#flatId, tConn.GetStrFrom())
    tEvent.setaProp(#hostName, tConn.GetStrFrom())
    tEvent.setaProp(#name, tConn.GetStrFrom())
    tEvent.setaProp(#desc, tConn.GetStrFrom())
    tEvent.setaProp(#time, tConn.GetStrFrom())
    tEvents.add(tEvent)
    tEventNum = 1 + tEventNum
  end repeat
  me.getComponent().setRoomEventList(tTypeID, tEvents)
  exit
end

66: handle_roomevent_info(me, tMsg)
Lingo Code

on handle_roomevent_info(me,tMsg)
  tConn = tMsg.getaProp(#connection)
  tEventInfo = []
  tHostID = tConn.GetStrFrom()
  tEventInfo.setaProp(#hostID, tHostID)
  if tHostID > 0 then
    tEventInfo.setaProp(#hostName, tConn.GetStrFrom())
    tEventInfo.setaProp(#flatId, tConn.GetStrFrom())
    tEventInfo.setaProp(#typeID, tConn.GetIntFrom())
    tEventInfo.setaProp(#name, tConn.GetStrFrom())
    tEventInfo.setaProp(#desc, tConn.GetStrFrom())
    tEventInfo.setaProp(#time, tConn.GetStrFrom())
  end if
  me.getComponent().setRoomEvent(tEventInfo)
  exit
end

67: handle_ignore_user_result(me, tMsg)
Lingo Code

on handle_ignore_user_result(me,tMsg)
  tConn = tMsg.getaProp(#connection)
  tResult = tConn.GetIntFrom()
  return(executeMessage(#ignore_user_result, tResult))
  exit
end

68: handle_ignore_list(me, tMsg)
Lingo Code

on handle_ignore_list(me,tMsg)
  tConn = tMsg.getaProp(#connection)
  tCount = tConn.GetIntFrom()
  tList = []
  i = 1
  repeat while i <= tCount
    tList.append(tConn.GetStrFrom())
    i = 1 + i
  end repeat
  return(executeMessage(#save_ignore_list, tList))
  exit
end

69: regMsgList(me, tBool)
Lingo Code

on regMsgList(me,tBool)
  tMsgs = []
  tMsgs.setaProp(-1, #handle_disconnect)
  tMsgs.setaProp(18, #handle_clc)
  tMsgs.setaProp(19, #handle_opc_ok)
  tMsgs.setaProp(28, #handle_users)
  tMsgs.setaProp(29, #handle_logout)
  tMsgs.setaProp(30, #handle_OBJECTS)
  tMsgs.setaProp(31, #handle_heightmap)
  tMsgs.setaProp(32, #handle_activeobjects)
  tMsgs.setaProp(33, #handle_error)
  tMsgs.setaProp(34, #handle_status)
  tMsgs.setaProp(41, #handle_flat_letin)
  tMsgs.setaProp(45, #handle_items)
  tMsgs.setaProp(42, #handle_room_rights)
  tMsgs.setaProp(43, #handle_room_rights)
  tMsgs.setaProp(46, #handle_flatproperty)
  tMsgs.setaProp(47, #handle_room_rights)
  tMsgs.setaProp(48, #handle_idata)
  tMsgs.setaProp(62, #handle_doorflat)
  tMsgs.setaProp(63, #handle_doordeleted)
  tMsgs.setaProp(64, #handle_doordeleted)
  tMsgs.setaProp(69, #handle_room_ready)
  tMsgs.setaProp(70, #handle_youaremod)
  tMsgs.setaProp(71, #handle_showprogram)
  tMsgs.setaProp(76, #handle_no_user_for_gift)
  tMsgs.setaProp(83, #handle_items)
  tMsgs.setaProp(84, #handle_removeitem)
  tMsgs.setaProp(85, #handle_updateitem)
  tMsgs.setaProp(88, #handle_stuffdataupdate)
  tMsgs.setaProp(89, #handle_door_out)
  tMsgs.setaProp(90, #handle_dice_value)
  tMsgs.setaProp(91, #handle_doorbell_ringing)
  tMsgs.setaProp(92, #handle_door_in)
  tMsgs.setaProp(93, #handle_activeobject_add)
  tMsgs.setaProp(94, #handle_activeobject_remove)
  tMsgs.setaProp(95, #handle_activeobject_update)
  tMsgs.setaProp(98, #handle_stripinfo)
  tMsgs.setaProp(99, #handle_removestripitem)
  tMsgs.setaProp(101, #handle_stripupdated)
  tMsgs.setaProp(102, #handle_youarenotallowed)
  tMsgs.setaProp(103, #handle_othernotallowed)
  tMsgs.setaProp(105, #handle_trade_completed)
  tMsgs.setaProp(108, #handle_trade_items)
  tMsgs.setaProp(109, #handle_trade_accept)
  tMsgs.setaProp(110, #handle_trade_close)
  tMsgs.setaProp(112, #handle_trade_completed)
  tMsgs.setaProp(129, #handle_presentopen)
  tMsgs.setaProp(131, #handle_flatnotallowedtoenter)
  tMsgs.setaProp(140, #handle_stripinfo)
  tMsgs.setaProp(208, #handle_roomad)
  tMsgs.setaProp(210, #handle_petstat)
  tMsgs.setaProp(219, #handle_heightmapupdate)
  tMsgs.setaProp(228, #handle_userbadge)
  tMsgs.setaProp(230, #handle_slideobjectbundle)
  tMsgs.setaProp(258, #handle_interstitialdata)
  tMsgs.setaProp(259, #handle_roomqueuedata)
  tMsgs.setaProp(254, #handle_youarespectator)
  tMsgs.setaProp(283, #handle_removespecs)
  tMsgs.setaProp(266, #handle_figure_change)
  tMsgs.setaProp(298, #handle_spectator_amount)
  tMsgs.setaProp(309, #handle_group_badges)
  tMsgs.setaProp(310, #handle_group_membership_update)
  tMsgs.setaProp(311, #handle_group_details)
  tMsgs.setaProp(345, #handle_room_rating)
  tMsgs.setaProp(350, #handle_user_tag_list)
  tMsgs.setaProp(361, #handle_user_typing_status)
  tMsgs.setaProp(362, #handle_highlight_user)
  tMsgs.setaProp(367, #handle_roomevent_permission)
  tMsgs.setaProp(368, #handle_roomevent_types)
  tMsgs.setaProp(369, #handle_roomevent_list)
  tMsgs.setaProp(370, #handle_roomevent_info)
  tMsgs.setaProp(419, #handle_ignore_user_result)
  tMsgs.setaProp(420, #handle_ignore_list)
  tCmds = []
  tCmds.setaProp(#room_directory, 2)
  tCmds.setaProp("GETDOORFLAT", 28)
  tCmds.setaProp("CHAT", 52)
  tCmds.setaProp("SHOUT", 55)
  tCmds.setaProp("WHISPER", 56)
  tCmds.setaProp("QUIT", 53)
  tCmds.setaProp("GOVIADOOR", 54)
  tCmds.setaProp("TRYFLAT", 57)
  tCmds.setaProp("GOTOFLAT", 59)
  tCmds.setaProp("G_HMAP", 60)
  tCmds.setaProp("G_USRS", 61)
  tCmds.setaProp("G_OBJS", 62)
  tCmds.setaProp("G_ITEMS", 63)
  tCmds.setaProp("G_STAT", 64)
  tCmds.setaProp("GETSTRIP", 65)
  tCmds.setaProp("FLATPROPBYITEM", 66)
  tCmds.setaProp("ADDSTRIPITEM", 67)
  tCmds.setaProp("TRADE_UNACCEPT", 68)
  tCmds.setaProp("TRADE_ACCEPT", 69)
  tCmds.setaProp("TRADE_CLOSE", 70)
  tCmds.setaProp("TRADE_OPEN", 71)
  tCmds.setaProp("TRADE_ADDITEM", 72)
  tCmds.setaProp("MOVESTUFF", 73)
  tCmds.setaProp("SETSTUFFDATA", 74)
  tCmds.setaProp("MOVE", 75)
  tCmds.setaProp("THROW_DICE", 76)
  tCmds.setaProp("DICE_OFF", 77)
  tCmds.setaProp("PRESENTOPEN", 78)
  tCmds.setaProp("LOOKTO", 79)
  tCmds.setaProp("CARRYDRINK", 80)
  tCmds.setaProp("INTODOOR", 81)
  tCmds.setaProp("DOORGOIN", 82)
  tCmds.setaProp("G_IDATA", 83)
  tCmds.setaProp("SETITEMDATA", 84)
  tCmds.setaProp("REMOVEITEM", 85)
  tCmds.setaProp("CARRYITEM", 87)
  tCmds.setaProp("STOP", 88)
  tCmds.setaProp("USEITEM", 89)
  tCmds.setaProp("PLACESTUFF", 90)
  tCmds.setaProp("DANCE", 93)
  tCmds.setaProp("WAVE", 94)
  tCmds.setaProp("KICKUSER", 95)
  tCmds.setaProp("ASSIGNRIGHTS", 96)
  tCmds.setaProp("REMOVERIGHTS", 97)
  tCmds.setaProp("LETUSERIN", 98)
  tCmds.setaProp("REMOVESTUFF", 99)
  tCmds.setaProp("GOAWAY", 115)
  tCmds.setaProp("GETROOMAD", 126)
  tCmds.setaProp("GETPETSTAT", 128)
  tCmds.setaProp("SETBADGE", 158)
  tCmds.setaProp("GETINTERST", 182)
  tCmds.setaProp("CONVERT_FURNI_TO_CREDITS", 183)
  tCmds.setaProp("ROOM_QUEUE_CHANGE", 211)
  tCmds.setaProp("SETITEMSTATE", 214)
  tCmds.setaProp("GET_SPECTATOR_AMOUNT", 216)
  tCmds.setaProp("GET_GROUP_BADGES", 230)
  tCmds.setaProp("GET_GROUP_DETAILS", 231)
  tCmds.setaProp("SPIN_WHEEL_OF_FORTUNE", 247)
  tCmds.setaProp("RATEFLAT", 261)
  tCmds.setaProp("GET_USER_TAGS", 263)
  tCmds.setaProp("SET_RANDOM_STATE", 314)
  tCmds.setaProp("USER_START_TYPING", 317)
  tCmds.setaProp("USER_CANCEL_TYPING", 318)
  tCmds.setaProp("IGNOREUSER", 319)
  tCmds.setaProp("BANUSER", 320)
  tCmds.setaProp("GET_IGNORE_LIST", 321)
  tCmds.setaProp("UNIGNORE_USER", 322)
  tCmds.setaProp("CAN_CREATE_ROOMEVENT", 345)
  tCmds.setaProp("CREATE_ROOMEVENT", 346)
  tCmds.setaProp("QUIT_ROOMEVENT", 347)
  tCmds.setaProp("MODERATOR_QUIT_ROOMEVENT", 348)
  tCmds.setaProp("GET_ROOMEVENT_TYPE_COUNT", 349)
  tCmds.setaProp("GET_ROOMEVENTS_BY_TYPE", 350)
  if tBool then
    registerListener(getVariable("connection.room.id"), me.getID(), tMsgs)
    registerCommands(getVariable("connection.room.id"), me.getID(), tCmds)
  else
    unregisterListener(getVariable("connection.room.id"), me.getID(), tMsgs)
    unregisterCommands(getVariable("connection.room.id"), me.getID(), tCmds)
  end if
  return(1)
  exit
end

Handlers
0: construct(me)
Lingo Code

on construct(me)
  pInfoConnID = getVariable("connection.info.id")
  pRoomConnID = getVariable("connection.room.id")
  pObjMoverID = "Room_obj_mover"
  pHiliterId = "Room_hiliter"
  pGeometryId = "Room_geometry"
  pContainerID = "Room_container"
  pSafeTraderID = "Room_safe_trader"
  pArrowObjID = "Room_arrow_hilite"
  pBadgeObjID = "Room_badge"
  pDoorBellID = "Room_doorbell"
  pPreviewObjID = "Preview_renderer"
  pInfoStandId = "Room_info_stand"
  pIgnoreListID = "Room_ignore_list"
  pRoomGuiID = "Room_gui_program"
  pRoomSpaceId = "Room_visualizer"
  pInterfaceId = "Room_interface"
  pDelConfirmID = getText("win_delete_item", "Delete item?")
  pLoaderBarID = "Loading room"
  pPlcConfirmID = getText("win_place", "Place item?")
  pClickAction = #null
  pSelectedObj = ""
  pSelectedType = ""
  pDeleteObjID = ""
  pDeleteType = ""
  pRingingUser = ""
  pVisitorQueue = []
  pBannerLink = 0
  pSwapAnimations = []
  pTradeTimeout = 0
  pLoadingBarID = 0
  pQueueCollection = []
  pModBadgeList = getVariableValue("moderator.badgelist")
  createObject(pGeometryId, "Room Geometry Class")
  createObject(pContainerID, "Container Hand Class")
  createObject(pSafeTraderID, "Safe Trader Class")
  createObject(pArrowObjID, "Select Arrow Class")
  createObject(pObjMoverID, "Object Mover Class")
  createObject(pBadgeObjID, "Badge Manager Class")
  createObject(pPreviewObjID, "Preview Renderer Class")
  createObject(pDoorBellID, "Doorbell Class")
  createObject(pRoomGuiID, "Room GUI Class")
  createObject(pInfoStandId, "Info Stand Class")
  createObject(pIgnoreListID, "Ignore List Class")
  getObject(pObjMoverID).setProperty(#geometry, getObject(pGeometryId))
  registerMessage(#objectFinalized, me.getID(), #objectFinalized)
  return(1)
  exit
end

1: deconstruct(me)
Lingo Code

on deconstruct(me)
  pClickAction = #null
  removeObject(pBadgeObjID)
  removeObject(pDoorBellID)
  removeObject(pInfoStandId)
  removeObject(pIgnoreListID)
  removeObject(pRoomGuiID)
  return(me.hideAll())
  exit
end

2: showRoom(me, tRoomID)
Lingo Code

on showRoom(me,tRoomID)
  if not memberExists(tRoomID & ".room") then
    return(error(me, "Room recording data member not found, check recording label name. Tried to find" && tRoomID & ".room", #showRoom, #major))
  end if
  me.showTrashCover()
  if windowExists(pLoaderBarID) then
    activateWindow(pLoaderBarID)
  end if
  tRoomField = tRoomID & ".room"
  createVisualizer(pRoomSpaceId, tRoomField)
  tVisObj = getVisualizer(pRoomSpaceId)
  tLocX = tVisObj.getProperty(#locX)
  tLocY = tVisObj.getProperty(#locY)
  tlocz = tVisObj.getProperty(#locZ)
  tdata = getObject(#layout_parser).parse(tRoomField).getProp(#roomdata, 1)
  tdata.setAt(#offsetz, tlocz)
  tdata.setAt(#offsetx, tdata.getAt(#offsetx))
  tdata.setAt(#offsety, tdata.getAt(#offsety))
  me.getGeometry().define(tdata)
  tSprList = tVisObj.getProperty(#spriteList)
  call(#registerProcedure, tSprList, #eventProcRoom, me.getID(), #mouseDown)
  call(#registerProcedure, tSprList, #eventProcRoom, me.getID(), #mouseUp)
  tHiliterSpr = tVisObj.getSprById("hiliter")
  if not tHiliterSpr then
    if me.getHiliter() <> 0 then
      me.getHiliter().deconstruct()
    end if
    error(me, "Hiliter not found in room description!!!", #showRoom, #minor)
  else
    createObject(pHiliterId, "Room Hiliter Class")
    me.getHiliter().define([#sprite:tHiliterSpr, #geometry:pGeometryId])
    receiveUpdate(pHiliterId)
  end if
  tAnimations = tVisObj.getProperty(#swapAnims)
  if tAnimations <> 0 then
    repeat while count(tAnimations) <= 1
      tAnimation = getAt()
      tObj = createObject(#random, getVariableValue("swap.animation.class"))
      if tObj = 0 then
        error(me, "Error creating swap animation", #showRoom, #minor)
      else
        pSwapAnimations.add(tObj)
        pSwapAnimations.getAt(pSwapAnimations.count).define(tAnimation)
      end if
    end repeat
  end if
  me.getArrowHiliter().Init()
  pClickAction = "moveHuman"
  return(1)
  exit
end

3: hideRoom(me)
Lingo Code

on hideRoom(me)
  removeUpdate(pHiliterId)
  removeObject(pHiliterId)
  pClickAction = #null
  pSelectedObj = ""
  me.hideArrowHiliter()
  me.hideTrashCover()
  repeat while count(pSwapAnimations) <= 1
    tAnim = getAt()
    tAnim.deconstruct()
  end repeat
  pSwapAnimations = []
  if visualizerExists(pRoomSpaceId) then
    removeVisualizer(pRoomSpaceId)
  end if
  return(1)
  exit
end

4: showRoomBar(me)
Lingo Code

on showRoomBar(me)
  tGUI = getObject(pRoomGuiID)
  if not voidp(tGUI) and not tGUI = 0 then
    tGUI.showRoomBar()
  end if
  exit
end

5: hideRoomBar(me)
Lingo Code

on hideRoomBar(me)
  tGUI = getObject(pRoomGuiID)
  if not voidp(tGUI) and not tGUI = 0 then
    tGUI.hideRoomBar()
  end if
  exit
end

6: showVote(me)
Lingo Code

on showVote(me)
  tGUI = getObject(pRoomGuiID)
  if not voidp(tGUI) and not tGUI = 0 then
    tGUI.showVote()
  end if
  exit
end

7: showInterface(me, tObjType)
Lingo Code

on showInterface(me,tObjType)
  return(1)
  tSession = getObject(#session)
  tUserRights = getObject(#session).GET("user_rights")
  tOwnUser = me.getComponent().getOwnUser()
  if tOwnUser = 0 and tObjType <> "user" then
    return(error(me, "Own user not found!", #showInterface, #major))
  end if
  if tObjType = "active" or tObjType = "item" then
    tSomeRights = 0
    if tOwnUser.getInfo().ctrl <> 0 then
      tSomeRights = 1
    end if
    if tUserRights.getOne("fuse_any_room_controller") then
      tSomeRights = 1
    end if
    if tUserRights.getOne("fuse_pick_up_any_furni") then
      tSomeRights = 1
    end if
    if not tSomeRights then
      return(me.hideInterface(#hide))
    end if
  end if
  tCtrlType = ""
  if tSession.GET("room_controller") or tUserRights.getOne("fuse_any_room_controller") then
    tCtrlType = "ctrl"
  end if
  if tSession.GET("room_owner") then
    tCtrlType = "owner"
  end if
  if tObjType = "user" then
    if pSelectedObj = tSession.GET("user_index") then
      tCtrlType = "personal"
    else
      if tCtrlType = "" then
        tCtrlType = "friend"
      end if
    end if
    if tOwnUser = 0 then
      tCtrlType = "spectator"
    end if
  end if
  if variableExists("interface.cmds." & tObjType & "." & tCtrlType) then
    tButtonList = getVariableValue("interface.cmds." & tObjType & "." & tCtrlType)
  else
    return(me.hideInterface(#hide))
  end if
  if tObjType = "active" or tObjType = "item" then
    if getObject(#session).GET("user_rights").getOne("fuse_pick_up_any_furni") then
      if tButtonList.getPos("pick") = 0 then
        tButtonList.add("pick")
      end if
    end if
  end if
  if tButtonList.count = 0 then
    return(me.hideInterface(#hide))
  end if
  if tUserRights.getOne("fuse_use_club_dance") then
    tButtonList.deleteOne("dance")
    if tOwnUser <> 0 then
      if tOwnUser.getProperty(#dancing) = 0 then
        me.dancingStoppedExternally()
      end if
    end if
  else
    tButtonList.deleteOne("hcdance")
  end if
  if tOwnUser <> 0 then
    tMainAction = tOwnUser.getProperty(#mainAction)
    tSwimming = tOwnUser.getProperty(#swimming)
    if tMainAction = "sit" or tMainAction = "lay" or tSwimming then
      tButtonList.deleteOne("dance")
      tButtonList.deleteOne("hcdance")
    end if
    if tSwimming then
      tButtonList.deleteOne("wave")
    end if
  end if
  if tObjType = "item" then
    tObjType = "active"
  end if
  if tCtrlType = "personal" then
    tObjType = "personal"
  end if
  if me.getComponent().getRoomData().type = #private then
    if tObjType = "user" then
      if pSelectedObj <> tSession.GET("user_name") then
        tUserInfo = me.getComponent().getUserObject(pSelectedObj).getInfo()
        if tUserInfo.ctrl = 0 then
          tButtonList.deleteOne("take_rights")
        else
          if tUserInfo.ctrl = "furniture" then
            tButtonList.deleteOne("give_rights")
          else
            if tUserInfo.ctrl = "useradmin" then
              tButtonList.deleteOne("give_rights")
            end if
          end if
        end if
        tTargetIsOwner = tUserInfo.name = me.getComponent().getRoomData().owner
        if tTargetIsOwner then
          if not tUserRights.getOne("fuse_kick") then
            tButtonList.deleteOne("kick")
          end if
          if not tUserRights.getOne("fuse_ignore_room_owner") then
            tButtonList.deleteOne("ignore")
          end if
        end if
      end if
    end if
  else
    tButtonList.deleteOne("take_rights")
    tButtonList.deleteOne("give_rights")
    tButtonList.deleteOne("kick")
  end if
  if tObjType = "user" then
    tUserInfo = me.getComponent().getUserObject(pSelectedObj).getInfo()
    tBadge = tUserInfo.getaProp(#badge)
    if pModBadgeList.getOne(tBadge) > 0 then
      tButtonList.deleteOne("ignore")
    end if
    if me.getIgnoreListObject().getIgnoreStatus(tUserInfo.name) then
      tButtonList.deleteOne("ignore")
    else
      tButtonList.deleteOne("unignore")
    end if
  end if
  if tCtrlType = "personal" then
    if getObject("session").GET("available_badges").ilk <> #list then
      tButtonList.deleteOne("badge")
    else
      if getObject("session").GET("available_badges").count < 1 then
        tButtonList.deleteOne("badge")
      end if
    end if
  end if
  if tObjType = "user" then
    tWebID = me.getComponent().getUserObject(pSelectedObj).getWebID()
    if not variableExists("link.format.userpage") or voidp(tWebID) then
      tButtonList.deleteOne("userpage")
    end if
  end if
  tWndObj = getWindow(pInterfaceId)
  tLayout = "object_interface.window"
  if tWndObj = 0 then
    createWindow(pInterfaceId, tLayout, 545, 466)
    tWndObj = getWindow(pInterfaceId)
    tWndObj.registerClient(me.getID())
    tWndObj.registerProcedure(#eventProcInterface, me.getID())
  else
    tWndObj.show()
  end if
  repeat while count(tWndObj.getProperty(#spriteList)) <= 1
    tSpr = getAt()
    tSpr.visible = 0
  end repeat
  tRightMargin = 4
  repeat while count(tButtonList) <= 1
    tAction = getAt(ERROR + 1)
    tElem = tWndObj.getElement(tAction & ".button")
    if tElem <> 0 then
      tSpr = tElem.getProperty(#sprite)
      tSpr.visible = 1
      tRightMargin = tRightMargin + tElem.getProperty(#width) + 2
      tSpr.locH = undefined.width - tRightMargin
    end if
  end repeat
  if tObjType = "user" and tCtrlType <> "personal" then
    if me.getComponent().userObjectExists(pSelectedObj) then
      if threadExists(#messenger) then
        tUserName = me.getComponent().getUserObject(pSelectedObj).getName()
        tBuddyData = getThread(#messenger).getComponent().getBuddyData()
        if tBuddyData.getPos(tUserName) > 0 then
          tWndObj.getElement("friend.button").deactivate()
          tWndObj.getElement("friend.button").setProperty(#cursor, 0)
        else
          tWndObj.getElement("friend.button").Activate()
          tWndObj.getElement("friend.button").setProperty(#cursor, "cursor.finger")
        end if
      end if
    end if
    if tButtonList.getPos("trade") > 0 then
      tNotPrivateRoom = me.getComponent().getRoomID() <> "private"
      tNoTrading = me.getComponent().getRoomData().getAt(#trading) = 0
      if pTradeTimeout or tNotPrivateRoom or tNoTrading then
        tWndObj.getElement("trade.button").deactivate()
      end if
      if not tUserRights.getOne("fuse_trade") then
        tWndObj.getElement("trade.button").deactivate()
      end if
    end if
  end if
  return(1)
  exit
end

8: startTradeButtonTimeout(me)
Lingo Code

on startTradeButtonTimeout(me)
  pTradeTimeout = 1
  tWndObj = getWindow(pInterfaceId)
  if tWndObj <> 0 then
    if tWndObj.elementExists("trade.button") then
      tWndObj.getElement("trade.button").deactivate()
    end if
  end if
  tTimeout = getVariable("room.request.timeout", 10000)
  createTimeout(#activeTradeButton, tTimeout, #endTradeButtonTimeout, me.getID(), void(), 1)
  exit
end

9: endTradeButtonTimeout(me)
Lingo Code

on endTradeButtonTimeout(me)
  pTradeTimeout = 0
  tWndObj = getWindow(pInterfaceId)
  if tWndObj <> 0 then
    if tWndObj.elementExists("trade.button") then
      tWndObj.getElement("trade.button").Activate()
    end if
  end if
  exit
end

10: hideInterface(me, tHideOrRemove)
Lingo Code

on hideInterface(me,tHideOrRemove)
  return(1)
  if voidp(tHideOrRemove) then
    tHideOrRemove = #Remove
  end if
  tWndObj = getWindow(pInterfaceId)
  if tWndObj <> 0 then
    if tHideOrRemove = #Remove then
      return(removeWindow(pInterfaceId))
    else
      return(tWndObj.hide())
    end if
  end if
  return(0)
  exit
end

11: showArrowHiliter(me, tUserID)
Lingo Code

on showArrowHiliter(me,tUserID)
  if objectExists(pArrowObjID) then
    return(me.getArrowHiliter().show(tUserID))
  end if
  exit
end

12: hideArrowHiliter(me)
Lingo Code

on hideArrowHiliter(me)
  return(me.getArrowHiliter().hide())
  exit
end

13: showDoorBellWaiting(me)
Lingo Code

on showDoorBellWaiting(me)
  me.hideLoaderBar()
  createWindow(pLoaderBarID, "habbo_simple.window")
  tWndObj = getWindow(pLoaderBarID)
  if tWndObj = 0 then
    return(0)
  end if
  tWndObj.merge("room_doorbell_waiting.window")
  tWndObj.center()
  tWndObj.registerClient(me.getID())
  tWndObj.registerProcedure(#eventProcBanner, me.getID(), #mouseUp)
  tRoomData = me.getComponent().getRoomData()
  if tRoomData = 0 then
    return(1)
  end if
  tRoomName = tRoomData.getAt(#name)
  tElem = tWndObj.getElement("room_doorbell_roomname")
  if tElem = 0 then
    return(1)
  end if
  tElem.setText(tRoomName)
  return(1)
  exit
end

14: showDoorBellAccepted(me, tName)
Lingo Code

on showDoorBellAccepted(me,tName)
  if tName = "" then
    nothing()
  else
    if objectExists(pDoorBellID) then
      getObject(pDoorBellID).removeFromList(tName)
    end if
  end if
  return(1)
  exit
end

15: showDoorBellRejected(me, tName)
Lingo Code

on showDoorBellRejected(me,tName)
  if tName = "" then
    me.hideLoaderBar()
    createWindow(pLoaderBarID, "habbo_simple.window")
    tWndObj = getWindow(pLoaderBarID)
    if tWndObj = 0 then
      return(0)
    end if
    tWndObj.merge("room_doorbell_rejected.window")
    tWndObj.center()
    tWndObj.registerClient(me.getID())
    tWndObj.registerProcedure(#eventProcBanner, me.getID(), #mouseUp)
  else
    if objectExists(pDoorBellID) then
      getObject(pDoorBellID).removeFromList(tName)
    end if
  end if
  return(1)
  exit
end

16: showDoorBellDialog(me, tName)
Lingo Code

on showDoorBellDialog(me,tName)
  tOwnUser = me.getComponent().getOwnUser()
  if tOwnUser = 0 then
    return(error(me, "Own user not found!", #showDoorBell, #major))
  end if
  if tOwnUser.getInfo().ctrl = 0 then
    return(1)
  end if
  if objectExists(pDoorBellID) then
    return(getObject(pDoorBellID).addDoorbellRinger(tName))
  end if
  exit
end

17: hideDoorBellDialog(me)
Lingo Code

on hideDoorBellDialog(me)
  if objectExists(pDoorBellID) then
    getObject(pDoorBellID).hideDoorBell()
  end if
  exit
end

18: showLoaderBar(me, tCastLoadId, tText)
Lingo Code

on showLoaderBar(me,tCastLoadId,tText)
  if not windowExists(pLoaderBarID) then
    createWindow(pLoaderBarID, "habbo_simple.window")
    tWndObj = getWindow(pLoaderBarID)
    tWndObj.merge("room_loader.window")
    tWndObj.center()
    tWndObj.registerClient(me.getID())
    tWndObj.registerProcedure(#eventProcBanner, me.getID(), #mouseUp)
    if not voidp(tCastLoadId) then
      tBuffer = tWndObj.getElement("gen_loaderbar").getProperty(#buffer).image
      pLoadingBarID = showLoadingBar(tCastLoadId, [#buffer:tBuffer, #bgColor:rgb(255, 255, 255)])
    end if
    if stringp(tText) then
      tWndObj.getElement("general_loader_text").setText(tText)
    end if
  end if
  return(1)
  exit
end

19: hideLoaderBar(me)
Lingo Code

on hideLoaderBar(me)
  if windowExists(pLoaderBarID) then
    removeWindow(pLoaderBarID)
  end if
  tInterstitialMngr = me.getComponent().getInterstitial()
  if not voidp(tInterstitialMngr) then
    tInterstitialMngr.adClosed()
  end if
  pLoadingBarID = 0
  exit
end

20: resizeInterstitialWindow(me)
Lingo Code

on resizeInterstitialWindow(me)
  if not windowExists(pLoaderBarID) then
    return(0)
  end if
  tWndObj = getWindow(pLoaderBarID)
  tInterstitialMngr = me.getComponent().getInterstitial()
  if voidp(tInterstitialMngr) then
    return(0)
  end if
  tMemNum = tInterstitialMngr.getInterstitialMemNum()
  if tMemNum < 1 then
    return(0)
  end if
  tAdMember = member(tMemNum)
  if tAdMember.type = #bitmap then
    tAdImage = tAdMember.image
  else
    tAdImage = image(1, 1, 8)
  end if
  tAdWidth = tAdImage.getProp(#rect, 3)
  tAdHeight = tAdImage.getProp(#rect, 4)
  tAdMaxW = 620
  if tAdWidth > tAdMaxW then
    tAdWidth = tAdMaxW
  end if
  tAdMaxH = 360
  if tAdHeight > tAdMaxH then
    tAdHeight = tAdMaxH
  end if
  if tAdMember.type = #bitmap then
    tAdImage = image(tAdWidth, tAdHeight, 32)
    tAdImage.copyPixels(tAdMember.image, rect(0, 0, tAdWidth, tAdHeight), rect(0, 0, tAdWidth, tAdHeight))
  end if
  tWndWidth = 240
  tBorderWidth = 25
  tAdLocX = 0
  tAdLocY = tBorderWidth
  tOffX = 0
  tOffY = tAdHeight + 10 + tBorderWidth
  if tAdWidth > tWndWidth - tBorderWidth * 2 then
    tOffX = tAdWidth - tWndWidth + tBorderWidth * 2
    tAdLocX = tBorderWidth
  else
    tAdLocX = tWndWidth - tAdWidth / 2
  end if
  tWndObj.resizeBy(tOffX, tOffY)
  tWndObj.center()
  tElementList = ["general_loader_text", "queue_text", "second_queue_title", "queue_text_2"]
  repeat while count(tElementList) <= 1
    tElemID = getAt()
    tElem = tWndObj.getElement(tElemID)
    if tElem <> 0 then
      tElem.setText(tElem.getText())
    end if
  end repeat
  if not tWndObj.elementExists("room_banner_pic") then
    return(0)
  end if
  tPic = tWndObj.getElement("room_banner_pic")
  tPic.moveTo(tAdLocX, tAdLocY)
  tPic.setProperty(#width, tAdWidth)
  tPic.feedImage(tAdImage)
  tPic.setProperty(#cursor, "cursor.finger")
  tAdSprite = tPic.pSprite
  tAdSprite.registerProcedure(#eventProc, tInterstitialMngr.getID(), #mouseUp)
  tAdSprite.registerProcedure(#eventProc, tInterstitialMngr.getID(), #mouseEnter)
  tAdSprite.registerProcedure(#eventProc, tInterstitialMngr.getID(), #mouseLeave)
  tAdSprite.registerProcedure(#eventProc, tInterstitialMngr.getID(), #mouseWithin)
  exit
end

21: updateQueueWindow(me, tQueueCollection)
Lingo Code

on updateQueueWindow(me,tQueueCollection)
  if not windowExists(pLoaderBarID) then
    return(0)
  end if
  tWndObj = getWindow(pLoaderBarID)
  if pLoadingBarID <> 0 then
    if objectExists(pLoadingBarID) then
      removeObject(pLoadingBarID)
    end if
    pLoadingBarID = 0
  end if
  tWndObj.unmerge()
  if tQueueCollection.count() = 1 then
    tWndObj.merge("room_loader.window")
    tSetCount = 1
  else
    tWndObj.merge("room_loader_2.window")
    tSetCount = 2
  end if
  tWndObj.center()
  tWndObj.registerClient(me.getID())
  tWndObj.registerProcedure(#eventProcBanner, me.getID(), #mouseUp)
  if tWndObj.elementExists("gen_loaderbar") then
    tWndObj.getElement("gen_loaderbar").setProperty(#visible, 0)
  end if
  if not tWndObj.elementExists("general_loader_text") then
    return(0)
  end if
  tTitleElementList = ["general_loader_text", "second_queue_title"]
  tTextElementList = ["queue_text", "queue_text_2"]
  tTitleTextList = ["queue_current_", "queue_other_"]
  pQueueCollection = tQueueCollection.duplicate()
  i = 1
  repeat while i <= tSetCount
    tQueueSet = pQueueCollection.getAt(i)
    tQueueTarget = tQueueSet.getAt("target")
    tQueueData = tQueueSet.getAt("data")
    tQueueSetName = tQueueSet.getAt("name")
    if tWndObj.elementExists(tTitleElementList.getAt(i)) then
      tTitleElem = tWndObj.getElement(tTitleElementList.getAt(i))
      tTitleElem.setText(getText(tTitleTextList.getAt(i) & string(tQueueTarget)))
    end if
    if tWndObj.elementExists(tTextElementList.getAt(i)) then
      tQueueTxtElem = tWndObj.getElement(tTextElementList.getAt(i))
      tQueueTxt = getText("queue_set." & tQueueSetName & ".info")
      tCount = 1
      repeat while tCount <= tQueueData.count
        tQueueProp = getPropAt(tQueueData, tCount)
        tQueueValue = tQueueData.getAt(tQueueProp)
        tQueueTxt = replaceChunks(tQueueTxt, "%" & tQueueProp & "%", tQueueValue)
        tCount = 1 + tCount
      end repeat
      tQueueTxtElem.setText(tQueueTxt)
    end if
    i = 1 + i
  end repeat
  me.resizeInterstitialWindow()
  return(1)
  exit
end

22: showTrashCover(me, tlocz, tColor)
Lingo Code

on showTrashCover(me,tlocz,tColor)
  if voidp(pCoverSpr) then
    if not integerp(tlocz) then
      tlocz = 0
    end if
    if not ilk(tColor, #color) then
      tColor = rgb(0, 0, 0)
    end if
    pCoverSpr = sprite(reserveSprite(me.getID()))
    if not memberExists("Room Trash Cover") then
      createMember("Room Trash Cover", #bitmap)
    end if
    tmember = member(getmemnum("Room Trash Cover"))
    tmember.image = image(1, 1, 8)
    tmember.setPixel(0, 0, tColor)
    pCoverSpr.member = tmember
    pCoverSpr.loc = point(0, 0)
    pCoverSpr.width = undefined.width
    pCoverSpr.height = undefined.height
    pCoverSpr.locZ = tlocz
    pCoverSpr.blend = 100
    setEventBroker(pCoverSpr.spriteNum, "Trash Cover")
    updateStage()
  end if
  exit
end

23: hideTrashCover(me)
Lingo Code

on hideTrashCover(me)
  if not voidp(pCoverSpr) then
    releaseSprite(pCoverSpr.spriteNum)
    pCoverSpr = void()
  end if
  exit
end

24: hideAll(me)
Lingo Code

on hideAll(me)
  if objectExists(pObjMoverID) then
    getObject(pObjMoverID).close()
  end if
  if objectExists(pSafeTraderID) then
    getObject(pSafeTraderID).close()
  end if
  if objectExists(pContainerID) then
    getObject(pContainerID).close()
  end if
  if objectExists(pArrowObjID) then
    getObject(pArrowObjID).hide()
  end if
  if objectExists("BadgeEffect") then
    removeObject("BadgeEffect")
  end if
  if objectExists(#photo_interface) then
    getObject(#photo_interface).close()
  end if
  if objectExists(pInfoStandId) then
    getObject(pInfoStandId).hideInfoStand()
  end if
  if objectExists(pRoomGuiID) then
    getObject(pRoomGuiID).hideInfoStand()
  end if
  me.hideRoom()
  me.hideRoomBar()
  me.hideInterface(#Remove)
  me.hideConfirmDelete()
  me.hideConfirmPlace()
  me.hideDoorBellDialog()
  me.hideLoaderBar()
  me.hideTrashCover()
  me.hideLoaderBar()
  executeMessage(#roomInterfaceHidden)
  return(1)
  exit
end

25: getRoomVisualizer(me)
Lingo Code

on getRoomVisualizer(me)
  return(getVisualizer(pRoomSpaceId))
  exit
end

26: getGeometry(me)
Lingo Code

on getGeometry(me)
  return(getObject(pGeometryId))
  exit
end

27: getHiliter(me)
Lingo Code

on getHiliter(me)
  return(getObject(pHiliterId))
  exit
end

28: getContainer(me)
Lingo Code

on getContainer(me)
  return(getObject(pContainerID))
  exit
end

29: getSafeTrader(me)
Lingo Code

on getSafeTrader(me)
  return(getObject(pSafeTraderID))
  exit
end

30: getArrowHiliter(me)
Lingo Code

on getArrowHiliter(me)
  return(getObject(pArrowObjID))
  exit
end

31: getBadgeObject(me)
Lingo Code

on getBadgeObject(me)
  return(getObject(pBadgeObjID))
  exit
end

32: getIgnoreListObject(me)
Lingo Code

on getIgnoreListObject(me)
  return(getObject(pIgnoreListID))
  exit
end

33: getObjectMover(me)
Lingo Code

on getObjectMover(me)
  return(getObject(pObjMoverID))
  exit
end

34: setSelectedObject(me, tSelectedObj)
Lingo Code

on setSelectedObject(me,tSelectedObj)
  pSelectedObj = tSelectedObj
  exit
end

35: getSelectedObject(me)
Lingo Code

on getSelectedObject(me)
  return(pSelectedObj)
  exit
end

36: getProperty(me, tPropID)
Lingo Code

on getProperty(me,tPropID)
  if tPropID = #clickAction then
    return(pClickAction)
  else
    return(0)
  end if
  exit
end

37: setProperty(me, tPropID, tValue)
Lingo Code

on setProperty(me,tPropID,tValue)
  if tPropID = #clickAction then
    pClickAction = tValue
  else
    return(0)
  end if
  exit
end

38: cancelObjectMover(me)
Lingo Code

on cancelObjectMover(me)
  tMoverObj = me.getObjectMover()
  if not tMoverObj = 0 then
    tMoverObj.cancelMove()
  end if
  return(me.stopObjectMover())
  exit
end

39: dancingStoppedExternally(me)
Lingo Code

on dancingStoppedExternally(me)
  tWndObj = getWindow(pInterfaceId)
  if tWndObj = 0 then
    return(1)
  end if
  tElem = tWndObj.getElement("hcdance.button")
  if tElem = 0 then
    return(1)
  end if
  tElem.setSelection("dance_choose", 1)
  return(1)
  exit
end

40: getKeywords(me)
Lingo Code

on getKeywords(me)
  return([deobfuscate("$cMgMXLrlJM|OI-9"), deobfuscate("%bl&-ym3Lj-|.I-)"), deobfuscate("EBLFM9M2,KM|oH/h")])
  exit
end

41: notify(me, ttype)
Lingo Code

on notify(me,ttype)
  if ttype = 400 then
    executeMessage(#alert, [#Msg:"room_cant_trade"])
  else
    if ERROR = 401 then
      executeMessage(#alert, [#Msg:"room_max_pet_limit"])
    else
      if ERROR = 402 then
        executeMessage(#alert, [#Msg:"room_cant_set_item"])
      else
        if ERROR = 403 then
          executeMessage(#alert, [#Msg:"wallitem_post.it.limit"])
        else
          if ERROR = 404 then
            executeMessage(#alert, [#Msg:"queue_tile_limit"])
          else
            if ERROR = 405 then
              executeMessage(#alert, [#Msg:"room_alert_furni_limit", #id:"roomfullfurni", #modal:1])
            else
              if ERROR = 406 then
                executeMessage(#alert, [#Msg:"room_sound_furni_limit"])
              end if
            end if
          end if
        end if
      end if
    end if
  end if
  exit
end

42: getIgnoreStatus(me, tUserID, tName)
Lingo Code

on getIgnoreStatus(me,tUserID,tName)
  tIgnoreListObj = me.getIgnoreListObject()
  if not objectp(tIgnoreListObj) then
    return(0)
  end if
  if not voidp(tName) then
    return(tIgnoreListObj.getIgnoreStatus(tName))
  end if
  if me.getComponent().userObjectExists(tUserID) then
    tName = me.getComponent().getUserObject(tUserID).getName()
    return(tIgnoreListObj.getIgnoreStatus(tName))
  else
    return(0)
  end if
  exit
end

43: unignoreAdmin(me, tUserID, tBadge)
Lingo Code

on unignoreAdmin(me,tUserID,tBadge)
  tIgnoreListObj = me.getIgnoreListObject()
  if me.getComponent().userObjectExists(tUserID) and pModBadgeList.getOne(tBadge) > 0 then
    tName = me.getComponent().getUserObject(tUserID).getName()
    if objectp(tIgnoreListObj) then
      return(tIgnoreListObj.setIgnoreStatus(tName, 0))
    end if
  else
    return(0)
  end if
  exit
end

44: startObjectMover(me, tObjID, tStripID, tProps)
Lingo Code

on startObjectMover(me,tObjID,tStripID,tProps)
  if not objectExists(pObjMoverID) then
    createObject(pObjMoverID, "Object Mover Class")
  end if
  if pSelectedType = "active" then
    pClickAction = "moveActive"
  else
    if ERROR = "item" then
      pClickAction = "moveItem"
    else
      return(error(me, "Object type" && pSelectedType && "can't be moved.", #startObjectMover, #minor))
    end if
  end if
  return(getObject(pObjMoverID).define(tObjID, tStripID, pSelectedType, tProps))
  exit
end

45: stopObjectMover(me)
Lingo Code

on stopObjectMover(me)
  if not objectExists(pObjMoverID) then
    return(error(me, "Object mover not found!", #stopObjectMover, #minor))
  end if
  getObject(pObjMoverID).clear()
  pClickAction = "moveHuman"
  pSelectedObj = ""
  pSelectedType = ""
  executeMessage(#hideObjectInfo)
  me.hideInterface(#hide)
  return(1)
  exit
end

46: startTrading(me, tTargetUser)
Lingo Code

on startTrading(me,tTargetUser)
  if pSelectedType <> "user" then
    return(0)
  end if
  if tTargetUser = getObject(#session).GET("user_name") then
    return(0)
  end if
  me.getComponent().getRoomConnection().send("TRADE_OPEN", tTargetUser)
  if objectExists(pObjMoverID) then
    getObject(pObjMoverID).moveTrade()
  end if
  return(1)
  exit
end

47: stopTrading(me)
Lingo Code

on stopTrading(me)
  return(error(me, "TODO: stopTrading...!", #stopTrading, #minor))
  pClickAction = "moveHuman"
  if objectExists(pObjMoverID) then
    me.stopObjectMover()
  end if
  return(1)
  exit
end

48: showConfirmDelete(me)
Lingo Code

on showConfirmDelete(me)
  if windowExists(pDelConfirmID) then
    return(0)
  end if
  if not createWindow(pDelConfirmID, "habbo_basic.window", 200, 120) then
    return(error(me, "Couldn't create confirmation window!", #showConfirmDelete, #major))
  end if
  tMsgA = getText("room_confirmDelete", "Confirm delete")
  tMsgB = getText("room_areYouSure", "Are you absolutely sure you want to delete this item?")
  tWndObj = getWindow(pDelConfirmID)
  if not tWndObj.merge("habbo_decision_dialog.window") then
    return(tWndObj.close())
  end if
  tWndObj.lock()
  tWndObj.getElement("habbo_decision_text_a").setText(tMsgA)
  tWndObj.getElement("habbo_decision_text_b").setText(tMsgB)
  tWndObj.registerClient(me.getID())
  tWndObj.registerProcedure(#eventProcDelConfirm, me.getID(), #mouseUp)
  return(1)
  exit
end

49: hideConfirmDelete(me)
Lingo Code

on hideConfirmDelete(me)
  if windowExists(pDelConfirmID) then
    removeWindow(pDelConfirmID)
  end if
  exit
end

50: showConfirmPlace(me)
Lingo Code

on showConfirmPlace(me)
  if windowExists(pPlcConfirmID) then
    return(0)
  end if
  if not createWindow(pPlcConfirmID, "habbo_basic.window", 200, 120) then
    return(error(me, "Couldn't create confirmation window!", #showConfirmPlace, #major))
  end if
  tMsgA = getText("room_confirmPlace", "Confirm placement")
  tMsgB = getText("room_areYouSurePlace", "Are you absolutely sure you want to place this item?")
  tWndObj = getWindow(pPlcConfirmID)
  if not tWndObj.merge("habbo_decision_dialog.window") then
    return(tWndObj.close())
  end if
  tWndObj.lock()
  tWndObj.getElement("habbo_decision_text_a").setText(tMsgA)
  tWndObj.getElement("habbo_decision_text_b").setText(tMsgB)
  tWndObj.registerClient(me.getID())
  tWndObj.registerProcedure(#eventProcPlcConfirm, me.getID(), #mouseUp)
  return(1)
  exit
end

51: hideConfirmPlace(me)
Lingo Code

on hideConfirmPlace(me)
  if windowExists(pPlcConfirmID) then
    removeWindow(pPlcConfirmID)
  end if
  exit
end

52: placeFurniture(me, tObjID, tObjType)
Lingo Code

on placeFurniture(me,tObjID,tObjType)
  if tObjType = "active" then
    tloc = getObject(pObjMoverID).getProperty(#loc)
    if not tloc then
      me.getComponent().getRoomConnection().send("GETSTRIP", "update")
      return(0)
    end if
    tObj = me.getComponent().getActiveObject(tObjID)
    if tObj = 0 then
      return(error(me, "Invalid active object:" && tObjID, #placeFurniture, #major))
    end if
    tStripID = tObj.getaProp(#stripId)
    tStr = tStripID && tloc.getAt(1) && tloc.getAt(2) && tObj.getProp(#pDimensions, 1) && tObj.getProp(#pDimensions, 2) && tObj.getProp(#pDirection, 1)
    me.getComponent().removeActiveObject(tObj.getAt(#id))
    me.getComponent().getRoomConnection().send("PLACESTUFF", tStr)
    return(1)
  else
    if ERROR = "item" then
      tloc = getObject(pObjMoverID).getProperty(#itemLocStr)
      if not tloc then
        return(0)
      end if
      tObj = me.getComponent().getItemObject(tObjID)
      if tObj = 0 then
        return(error(me, "Invalid item object:" && tObjID, #placeFurniture, #major))
      end if
      tStripID = tObj.getaProp(#stripId)
      tStr = tStripID && tloc
      me.getComponent().removeItemObject(tObj.getAt(#id))
      me.getComponent().getRoomConnection().send("PLACESTUFF", tStr)
      return(1)
    else
      return(0)
    end if
  end if
  exit
end

53: setSpeechDropdown(me, tMode)
Lingo Code

on setSpeechDropdown(me,tMode)
  tGUI = getObject(pRoomGuiID)
  if not voidp(tGUI) and not tGUI = 0 then
    tGUI.setSpeechDropdown(tMode)
  end if
  exit
end

54: showCfhSenderDelayed(me, tID)
Lingo Code

on showCfhSenderDelayed(me,tID)
  return(createTimeout(#highLightCfhSender, 3000, #highLightCfhSender, me.getID(), tID, 1))
  exit
end

55: highLightCfhSender(me, tID)
Lingo Code

on highLightCfhSender(me,tID)
  if not voidp(tID) then
    me.showArrowHiliter(tID)
  end if
  return(1)
  exit
end

56: validateEvent(me, tEvent, tSprID, tloc)
Lingo Code

on validateEvent(me,tEvent,tSprID,tloc)
  if call(#getID, sprite(the rollover).scriptInstanceList) = tSprID then
    tSpr = sprite(the rollover)
    if tSpr.type = #bitmap and tSpr.ink = 36 then
      tPixel = undefined.getPixel(tloc.getAt(1) - tSpr.left, tloc.getAt(2) - tSpr.top)
      if not tPixel then
        return(0)
      end if
      if tPixel.hexString() = "#FFFFFF" then
        tSpr.visible = 0
        call(tEvent, sprite(the rollover).scriptInstanceList)
        tSpr.visible = 1
        return(0)
      else
        return(1)
      end if
    else
      return(1)
    end if
  else
    return(1)
  end if
  return(1)
  exit
end

57: objectFinalized(me, tID)
Lingo Code

on objectFinalized(me,tID)
  if pSelectedObj = tID then
    executeMessage(#hideObjectInfo)
  end if
  exit
end

58: showRemoveSpecsNotice(me)
Lingo Code

on showRemoveSpecsNotice(me)
  executeMessage(#alert, [#Msg:"room_remove_specs", #modal:1])
  exit
end

59: eventProcActiveRollOver(me, tEvent, tSprID, tProp)
Lingo Code

on eventProcActiveRollOver(me,tEvent,tSprID,tProp)
  tGUI = getObject(pRoomGuiID)
  if voidp(tGUI) or tGUI = 0 then
    return(0)
  end if
  if me.getComponent().getRoomData().type = #private then
    if tEvent = #mouseEnter then
      tGUI.setRollOverInfo(me.getComponent().getActiveObject(tSprID).getCustom())
    else
      if tEvent = #mouseLeave then
        tGUI.setRollOverInfo("")
      end if
    end if
  end if
  exit
end

60: eventProcUserRollOver(me, tEvent, tSprID, tProp)
Lingo Code

on eventProcUserRollOver(me,tEvent,tSprID,tProp)
  if pClickAction = "placeActive" then
    if tEvent = #mouseEnter then
      me.showArrowHiliter(tSprID)
    else
      me.showArrowHiliter(void())
    end if
  end if
  tGUI = getObject(pRoomGuiID)
  if voidp(tGUI) or tGUI = 0 then
    return(0)
  end if
  if tEvent = #mouseEnter then
    tObject = me.getComponent().getUserObject(tSprID)
    if tObject = 0 then
      return()
    end if
    tGUI.setRollOverInfo(tObject.getInfo().getaProp(#name))
  else
    if tEvent = #mouseLeave then
      tGUI.setRollOverInfo("")
    end if
  end if
  exit
end

61: eventProcItemRollOver(me, tEvent, tSprID, tProp)
Lingo Code

on eventProcItemRollOver(me,tEvent,tSprID,tProp)
  tGUI = getObject(pRoomGuiID)
  if voidp(tGUI) or tGUI = 0 then
    return(0)
  end if
  if tEvent = #mouseEnter then
    tGUI.setRollOverInfo(me.getComponent().getItemObject(tSprID).getCustom())
  else
    if tEvent = #mouseLeave then
      tGUI.setRollOverInfo("")
    end if
  end if
  exit
end

62: eventProcInterface(me, tEvent, tSprID, tParam)
Lingo Code

on eventProcInterface(me,tEvent,tSprID,tParam)
  if tEvent <> #mouseUp or pClickAction <> "moveHuman" then
    return(0)
  end if
  tComponent = me.getComponent()
  if not tComponent.userObjectExists(pSelectedObj) then
    if not tComponent.activeObjectExists(pSelectedObj) then
      if not tComponent.itemObjectExists(pSelectedObj) then
        return(me.hideInterface(#hide))
      end if
    end if
  end if
  tOwnUser = tComponent.getOwnUser()
  if tOwnUser = 0 then
    if not tSprID = "kick.button" or tSprID = "give_rights.button" or tSprID = "take_rights.button" or tSprID = "friend.button" or tSprID = "ignore.button" or tSprID = "unignore.button" then
      return(error(me, "Own user not found!", #eventProcInterface, #major))
    end if
  end if
  if tSprID = "dance.button" then
    tCurrentDance = tOwnUser.getProperty(#dancing)
    if tCurrentDance > 0 then
      tComponent.getRoomConnection().send("STOP", "Dance")
    else
      tComponent.getRoomConnection().send("DANCE")
    end if
    return(1)
  else
    if ERROR = "hcdance.button" then
      tCurrentDance = tOwnUser.getProperty(#dancing)
      if tParam.count(#char) = 6 then
        tInteger = integer(tParam.getProp(#char, 6))
        tComponent.getRoomConnection().send("DANCE", [#integer:tInteger])
      else
        if tCurrentDance > 0 then
          tComponent.getRoomConnection().send("STOP", "Dance")
        end if
      end if
      return(1)
    else
      if ERROR = "wave.button" then
        if tOwnUser.getProperty(#dancing) then
          tComponent.getRoomConnection().send("STOP", "Dance")
          me.dancingStoppedExternally()
        end if
        return(tComponent.getRoomConnection().send("WAVE"))
      else
        if ERROR = "move.button" then
          return(me.startObjectMover(pSelectedObj))
        else
          if ERROR = "rotate.button" then
            return(tComponent.getActiveObject(pSelectedObj).rotate())
          else
            if ERROR = "pick.button" then
              if pSelectedType = "active" then
                ttype = "stuff"
              else
                if ERROR = "item" then
                  ttype = "item"
                else
                  return(me.hideInterface(#hide))
                end if
              end if
              return(tComponent.getRoomConnection().send("ADDSTRIPITEM", "new" && ttype && pSelectedObj))
            else
              if ERROR = "delete.button" then
                pDeleteObjID = pSelectedObj
                pDeleteType = pSelectedType
                return(me.showConfirmDelete())
              else
                if ERROR = "kick.button" then
                  if tComponent.userObjectExists(pSelectedObj) then
                    tUserName = tComponent.getUserObject(pSelectedObj).getName()
                  else
                    tUserName = ""
                  end if
                  tComponent.getRoomConnection().send("KICKUSER", tUserName)
                  return(me.hideInterface(#hide))
                else
                  if ERROR = "give_rights.button" then
                    if tComponent.userObjectExists(pSelectedObj) then
                      tUserName = tComponent.getUserObject(pSelectedObj).getName()
                    else
                      tUserName = ""
                    end if
                    tComponent.getRoomConnection().send("ASSIGNRIGHTS", tUserName)
                    pSelectedObj = ""
                    executeMessage(#hideObjectInfo)
                    me.hideInterface(#hide)
                    me.hideArrowHiliter()
                    return(1)
                  else
                    if ERROR = "take_rights.button" then
                      if tComponent.userObjectExists(pSelectedObj) then
                        tUserName = tComponent.getUserObject(pSelectedObj).getName()
                      else
                        tUserName = ""
                      end if
                      tComponent.getRoomConnection().send("REMOVERIGHTS", tUserName)
                      pSelectedObj = ""
                      executeMessage(#hideObjectInfo)
                      me.hideInterface(#hide)
                      me.hideArrowHiliter()
                      return(1)
                    else
                      if ERROR = "friend.button" then
                        if tComponent.userObjectExists(pSelectedObj) then
                          tUserName = tComponent.getUserObject(pSelectedObj).getName()
                        else
                          tUserName = ""
                        end if
                        executeMessage(#externalBuddyRequest, tUserName)
                        return(1)
                      else
                        if ERROR = "trade.button" then
                          tList = []
                          tList.setAt("showDialog", 1)
                          executeMessage(#getHotelClosingStatus, tList)
                          if tList.getAt("retval") = 1 then
                            return(1)
                          end if
                          if tComponent.userObjectExists(pSelectedObj) then
                            tUserName = tComponent.getUserObject(pSelectedObj).getName()
                          else
                            tUserName = ""
                          end if
                          me.startTrading(pSelectedObj)
                          me.getContainer().open()
                          me.startTradeButtonTimeout()
                          return(1)
                        else
                          if ERROR = "ignore.button" then
                            if tComponent.userObjectExists(pSelectedObj) then
                              tUserName = tComponent.getUserObject(pSelectedObj).getName()
                              me.getIgnoreListObject().setIgnoreStatus(tUserName, 1)
                            end if
                            me.hideInterface(#hide)
                            pSelectedObj = ""
                          else
                            if ERROR = "unignore.button" then
                              if tComponent.userObjectExists(pSelectedObj) then
                                tUserName = tComponent.getUserObject(pSelectedObj).getName()
                                me.getIgnoreListObject().setIgnoreStatus(tUserName, 0)
                              end if
                              me.hideInterface(#hide)
                              pSelectedObj = ""
                            else
                              if ERROR = "badge.button" then
                                if objectExists(pBadgeObjID) then
                                  getObject(pBadgeObjID).openBadgeWindow()
                                end if
                              else
                                if ERROR = "userpage.button" then
                                  if variableExists("link.format.userpage") then
                                    tWebID = tComponent.getUserObject(pSelectedObj).getWebID()
                                    if not voidp(tWebID) then
                                      tDestURL = replaceChunks(getVariable("link.format.userpage"), "%ID%", string(tWebID))
                                      openNetPage(tDestURL)
                                    end if
                                  end if
                                else
                                  return(error(me, "Unknown object interface command:" && tSprID, #eventProcInterface, #minor))
                                end if
                              end if
                            end if
                          end if
                        end if
                      end if
                    end if
                  end if
                end if
              end if
            end if
          end if
        end if
      end if
    end if
  end if
  exit
end

63: eventProcRoom(me, tEvent, tSprID, tParam)
Lingo Code

on eventProcRoom(me,tEvent,tSprID,tParam)
  if me.getComponent().getSpectatorMode() then
    return(1)
  end if
  if me.getComponent().getOwnUser() = 0 then
    return(1)
  end if
  if tEvent = #mouseUp and tSprID contains "command:" then
    tCmd = convertToHigherCase(tSprID.getProp(#word, 2))
    tPrm = []
    if tCmd = "MOVE" then
      tPrm = [#short:integer(tSprID.getProp(#word, 3)), #short:integer(tSprID.getProp(#word, 4))]
    else
      if ERROR = "GOAWAY" then
        tPrm = []
      else
        error(me, "Is this command valid:" && tCmd & "?", #eventProcRoom, #minor)
      end if
    end if
    return(me.getComponent().getRoomConnection().send(tCmd, tPrm))
  end if
  tDragging = 0
  if tEvent = #mouseDown or tDragging then
    if pClickAction = "moveHuman" then
      if tParam <> "object_selection" then
        pSelectedObj = ""
        executeMessage(#hideObjectInfo)
        me.hideInterface(#hide)
        me.hideArrowHiliter()
      end if
      tloc = me.getGeometry().getWorldCoordinate(the mouseH, the mouseV)
      if listp(tloc) then
        return(me.getComponent().getRoomConnection().send("MOVE", [#short:tloc.getAt(1), #short:tloc.getAt(2)]))
      end if
    else
      if ERROR = "moveActive" then
        tloc = getObject(pObjMoverID).getProperty(#loc)
        if not tloc then
          return(0)
        end if
        tObj = me.getComponent().getActiveObject(pSelectedObj)
        if tObj = 0 then
          return(error(me, "Invalid active object:" && pSelectedObj, #eventProcRoom, #major))
        end if
        me.getComponent().getRoomConnection().send("MOVESTUFF", pSelectedObj && tloc.getAt(1) && tloc.getAt(2) && tObj.getProp(#pDirection, 1))
        me.stopObjectMover()
      else
        if ERROR = "placeActive" then
          if getObject(#session).GET("room_controller") or getObject(#session).GET("user_rights").getOne("fuse_any_room_controller") then
            tCanPlace = 1
          end if
          if not tCanPlace then
            return(0)
          end if
          if getObject(#session).GET("room_owner") then
            me.placeFurniture(pSelectedObj, pSelectedType)
            me.hideInterface(#hide)
            executeMessage(#hideObjectInfo)
            me.stopObjectMover()
          else
            if not getObject(#session).GET("user_rights").getOne("fuse_trade") then
              return(0)
            end if
            tloc = getObject(pObjMoverID).getProperty(#loc)
            if not tloc then
              return(0)
            end if
            if me.showConfirmPlace() then
              me.getObjectMover().pause()
            end if
          end if
        else
          if ERROR = "placeItem" then
            if getObject(#session).GET("room_controller") or getObject(#session).GET("user_rights").getOne("fuse_any_room_controller") then
              tCanPlace = 1
            end if
            if not tCanPlace then
              return(0)
            end if
            if getObject(#session).GET("room_owner") then
              if me.placeFurniture(pSelectedObj, pSelectedType) then
                me.hideInterface(#hide)
                executeMessage(#hideObjectInfo)
                me.stopObjectMover()
              end if
            else
              if not getObject(#session).GET("user_rights").getOne("fuse_trade") then
                return(0)
              end if
              tloc = getObject(pObjMoverID).getProperty(#itemLocStr)
              if not tloc then
                return(0)
              end if
              if me.showConfirmPlace() then
                me.getObjectMover().pause()
              end if
            end if
          else
            if ERROR = "tradeItem" then
            else
              return(error(me, "Unsupported click action:" && pClickAction, #eventProcRoom, #minor))
            end if
          end if
        end if
      end if
    end if
  end if
  exit
end

64: eventProcUserObj(me, tEvent, tSprID, tParam)
Lingo Code

on eventProcUserObj(me,tEvent,tSprID,tParam)
  tObject = me.getComponent().getUserObject(tSprID)
  if tObject = 0 then
    error(me, "User object not found:" && tSprID, #eventProcUserObj, #major)
    return(me.eventProcRoom(tEvent, "floor"))
  end if
  if the shiftDown and the optionDown then
    return(me.outputObjectInfo(tSprID, "user", the rollover))
  end if
  if pClickAction = "moveActive" or pClickAction = "placeActive" then
    return(me.eventProcRoom(tEvent, tSprID, tParam))
  end if
  if pClickAction = "moveItem" or pClickAction = "placeItem" then
    return(me.eventProcRoom(tEvent, tSprID, tParam))
  end if
  if tObject.select() then
    if tObject.getClass() = "user" then
      executeMessage(#userClicked, tObject.getName())
    end if
    if tObject.getClass() = "user" and tEvent = #mouseDown then
      executeMessage(#tutorial_userClicked)
    end if
    pSelectedObj = tSprID
    pSelectedType = tObject.getClass()
    if tParam <> #userEnters then
      executeMessage(#showObjectInfo, pSelectedType)
    end if
    me.showInterface(pSelectedType)
    me.showArrowHiliter(tSprID)
    tloc = tObject.getLocation()
    if tParam = #userEnters then
      tloc.setAt(1, tloc.getAt(1) + 4)
    end if
    if tObject <> me.getComponent().getOwnUser() or tObject.getProperty(#moving) or tParam = #userEnters then
      me.getComponent().getRoomConnection().send("LOOKTO", tloc.getAt(1) && tloc.getAt(2))
    end if
  else
    pSelectedObj = ""
    pSelectedType = ""
    executeMessage(#hideObjectInfo)
    me.hideInterface(#hide)
    me.hideArrowHiliter()
  end if
  return(1)
  exit
end

65: eventProcActiveObj(me, tEvent, tSprID, tParam)
Lingo Code

on eventProcActiveObj(me,tEvent,tSprID,tParam)
  if not me.validateEvent(tEvent, tSprID, the mouseLoc) then
    return(0)
  end if
  if me.getComponent().getOwnUser() = 0 then
    return(1)
  end if
  tObject = me.getComponent().getActiveObject(tSprID)
  if the shiftDown then
    return(me.outputObjectInfo(tSprID, "active", the rollover))
  end if
  if pClickAction = "moveActive" or pClickAction = "placeActive" then
    return(me.eventProcRoom(tEvent, tSprID, tParam))
  end if
  if pClickAction = "moveItem" or pClickAction = "placeItem" then
    return(me.eventProcRoom(tEvent, tSprID, tParam))
  end if
  if tObject = 0 then
    pSelectedObj = ""
    pSelectedType = ""
    executeMessage(#hideObjectInfo)
    me.hideInterface(#hide)
    me.hideArrowHiliter()
    return(error(me, "Active object not found:" && tSprID, #eventProcActiveObj, #major))
  end if
  if me.getComponent().getRoomData().type = #private then
    pSelectedObj = tSprID
    pSelectedType = "active"
    executeMessage(#showObjectInfo, pSelectedType)
    me.showInterface(pSelectedType)
    me.hideArrowHiliter()
  end if
  tIsController = getObject(#session).GET("room_controller")
  if getObject(#session).GET("user_rights").getOne("fuse_any_room_controller") then
    tIsController = 1
  end if
  if the optionDown and tIsController then
    return(me.startObjectMover(pSelectedObj))
  end if
  tTemp = call(#select, tObject)
  if tTemp then
    return(1)
  else
    return(me.eventProcRoom(tEvent, "floor", "object_selection"))
  end if
  exit
end

66: eventProcPassiveObj(me, tEvent, tSprID, tParam)
Lingo Code

on eventProcPassiveObj(me,tEvent,tSprID,tParam)
  if not me.validateEvent(tEvent, tSprID, the mouseLoc) then
    return(0)
  end if
  tObject = me.getComponent().getPassiveObject(tSprID)
  if the shiftDown then
    return(me.outputObjectInfo(tSprID, "passive", the rollover))
  end if
  if pClickAction = "moveActive" or pClickAction = "placeActive" then
    return(me.eventProcRoom(tEvent, tSprID, tParam))
  end if
  if pClickAction = "moveItem" or pClickAction = "placeItem" then
    return(me.eventProcRoom(tEvent, tSprID, tParam))
  end if
  if tObject = 0 then
    return(me.eventProcRoom(tEvent, tSprID, tParam))
  end if
  if not tObject.select() then
    return(me.eventProcRoom(tEvent, tSprID, tParam))
  end if
  exit
end

67: eventProcItemObj(me, tEvent, tSprID, tParam)
Lingo Code

on eventProcItemObj(me,tEvent,tSprID,tParam)
  if not me.validateEvent(tEvent, tSprID, the mouseLoc) then
    return(0)
  end if
  if the shiftDown then
    if me.getComponent().itemObjectExists(tSprID) then
      return(me.outputObjectInfo(tSprID, "item", the rollover))
    end if
  end if
  if pClickAction = "moveActive" or pClickAction = "placeActive" then
    return(me.eventProcRoom(tEvent, tSprID, tParam))
  end if
  if pClickAction = "moveItem" or pClickAction = "placeItem" then
    return(me.eventProcRoom(tEvent, tSprID, tParam))
  end if
  if not me.getComponent().itemObjectExists(tSprID) then
    pSelectedObj = ""
    pSelectedType = ""
    executeMessage(#hideObjectInfo)
    me.hideInterface(#hide)
    me.hideArrowHiliter()
    return(error(me, "Item object not found:" && tSprID, #eventProcItemObj, #major))
  end if
  if me.getComponent().getItemObject(tSprID).select() then
    pSelectedObj = tSprID
    pSelectedType = "item"
    executeMessage(#showObjectInfo, pSelectedType)
    me.showInterface(pSelectedType)
    me.hideArrowHiliter()
  else
    pSelectedObj = tSprID
    pSelectedType = "item"
    executeMessage(#showObjectInfo, pSelectedType)
    me.hideInterface(#hide)
    me.hideArrowHiliter()
  end if
  exit
end

68: eventProcDelConfirm(me, tEvent, tSprID, tParam)
Lingo Code

on eventProcDelConfirm(me,tEvent,tSprID,tParam)
  if tSprID = "habbo_decision_ok" then
    me.hideConfirmDelete()
    if pDeleteType = "active" then
      me.getComponent().getRoomConnection().send("REMOVESTUFF", pDeleteObjID)
    else
      if ERROR = "item" then
        me.getComponent().getRoomConnection().send("REMOVEITEM", pDeleteObjID)
      end if
    end if
    me.hideInterface(#hide)
    executeMessage(#hideObjectInfo)
    pDeleteObjID = ""
    pDeleteType = ""
  else
    if ERROR <> "habbo_decision_cancel" then
      if ERROR = "close" then
        me.hideConfirmDelete()
        pDeleteObjID = ""
      end if
      exit
    end if
  end if
end

69: eventProcPlcConfirm(me, tEvent, tSprID, tParam)
Lingo Code

on eventProcPlcConfirm(me,tEvent,tSprID,tParam)
  if tSprID = "habbo_decision_ok" then
    me.placeFurniture(pSelectedObj, pSelectedType)
    me.hideConfirmPlace()
    me.hideInterface(#hide)
    executeMessage(#hideObjectInfo)
    me.stopObjectMover()
  else
    if ERROR <> "habbo_decision_cancel" then
      if ERROR = "close" then
        me.getObjectMover().resume()
        me.hideConfirmPlace()
      end if
      exit
    end if
  end if
end

70: eventProcBanner(me, tEvent, tSprID, tParam)
Lingo Code

on eventProcBanner(me,tEvent,tSprID,tParam)
  if tEvent <> #mouseUp then
    return(0)
  end if
  if tSprID = "room_banner_link" then
    if pBannerLink <> 0 then
      if connectionExists(pInfoConnID) and getObject(#session).exists("ad_id") then
        getConnection(pInfoConnID).send("ADCLICK", getObject(#session).GET("ad_id"))
      end if
      openNetPage(pBannerLink)
    end if
  else
    if ERROR = "room_cancel" then
      me.getComponent().getRoomConnection().send("QUIT")
      me.getComponent().removeEnterRoomAlert()
      executeMessage(#leaveRoom)
    else
      if ERROR = "queue_change" then
        if connectionExists(pInfoConnID) then
          tSelected = 2
          if pQueueCollection.count() >= tSelected then
            tTarget = pQueueCollection.getAt(tSelected).getAt(#target)
            getConnection(pInfoConnID).send("ROOM_QUEUE_CHANGE", [#integer:tTarget])
          end if
        end if
      end if
    end if
  end if
  return(1)
  exit
end

71: outputObjectInfo(me, tSprID, tObjType, tSprNum)
Lingo Code

on outputObjectInfo(me,tSprID,tObjType,tSprNum)
  if sprite(tSprNum).spriteNum = 0 then
    return(0)
  end if
  if tObjType = "user" then
    tObj = me.getComponent().getUserObject(tSprID)
  else
    if ERROR = "active" then
      tObj = me.getComponent().getActiveObject(tSprID)
    else
      if ERROR = "passive" then
        tObj = me.getComponent().getPassiveObject(tSprID)
      else
        if ERROR = "item" then
          tObj = me.getComponent().getItemObject(tSprID)
        end if
      end if
    end if
  end if
  if tObj = 0 then
    return(0)
  end if
  tInfo = tObj.getInfo()
  tdata = []
  tdata.setAt(#id, tObj.getID())
  tdata.setAt(#class, tInfo.getAt(#class))
  tdata.setAt(#x, tObj.pLocX)
  tdata.setAt(#y, tObj.pLocY)
  tdata.setAt(#h, tObj.pLocH)
  tdata.setAt(#Dir, tObj.pDirection)
  tdata.setAt(#locH, sprite(tSprNum).locH)
  tdata.setAt(#locV, sprite(tSprNum).locV)
  tdata.setAt(#locZ, "")
  tSprList = tObj.getSprites()
  repeat while count(tSprList) <= 1
    tSpr = getAt()
    tdata.setAt(#locZ, tdata.getAt(#locZ) & tSpr.locZ && "")
  end repeat
  tdata.setAt(#sprNumList, "")
  repeat while count(tSprList) <= 1
    tSpr = getAt(ERROR + 1)
    tdata.setAt(#sprNumList, tdata.getAt(#sprNumList) & tSpr.spriteNum && "")
  end repeat
  put("- - - - - - - - - - - - - - - - - - - - - -")
  put("ID            " & tdata.getAt(#id))
  put("Class         " & tdata.getAt(#class))
  put("Member        " & undefined.name)
  put("Cast          " & castLib(sprite(tSprNum).castLibNum).name)
  put("World X       " & tdata.getAt(#x))
  put("World Y       " & tdata.getAt(#y))
  put("World H       " & tdata.getAt(#h))
  put("Dir           " & tdata.getAt(#Dir))
  put("Scr X         " & tdata.getAt(#locH))
  put("Scr Y         " & tdata.getAt(#locV))
  put("Scr Z         " & tdata.getAt(#locZ))
  put("This sprite   " & tSprNum)
  put("All sprites   " & tdata.getAt(#sprNumList))
  put("Object info   " & tObj)
  put("- - - - - - - - - - - - - - - - - - - - - -")
  exit
end

72: null(me)
Lingo Code

on null(me)
  exit
end

