<commit_before>require("base.keys")
require("base.common")

module("item.keys", package.seeall)

-- UPDATE common SET com_script='item.keys' WHERE com_itemid IN (2121,2122,2123,2124,2141,2144,2145,2161,2556,2558,3054,3055,3056);

function UseItem(User,SourceItem,TargetItem,counter,param)
    local WALLPOS = position(-470,241,0);
    local DoorItem = base.common.GetFrontItem( User );
    
	if SourceItem:getData("prisonKeyOf") ~= "" then 
	    -- sentence char to forced labour
		SentenceCharacter(User,SourceItem)
	    return
	end	

    if SourceItem.data == 7300 and DoorItem.id == 287 and DoorItem.pos == WALLPOS then

		world:erase(DoorItem,1);
		local charList = world:getPlayersInRangeOf(WALLPOS,15);
		for i,char in pairs(charList) do
			if char.pos.z == WALLPOS.z then
			    base.common.InformNLS(User,"Du hrst das Gerusch von sich verschiebendem Gestein.","You hear the sound of moving stone.");
			end
		end
	elseif base.keys.CheckKey(SourceItem,DoorItem) then
		debug("doorQual "..DoorItem.quality.." data "..Door:getData("lockData"))
		debug("LockDoor: "..base.keys.LockDoor(DoorItem).." UnlockDoor: "..base.keys.UnlockDoor(DoorItem))		
        if base.keys.LockDoor(DoorItem) then
            base.common.InformNLS(User,"Du sperrst die Tr ab.","You lock the door.");
        elseif base.keys.UnlockDoor(DoorItem) then            <commit_msg>added debug messages<commit_after>require("base.keys")
require("base.common")

module("item.keys", package.seeall)

-- UPDATE common SET com_script='item.keys' WHERE com_itemid IN (2121,2122,2123,2124,2141,2144,2145,2161,2556,2558,3054,3055,3056);

function UseItem(User,SourceItem,TargetItem,counter,param)
    local WALLPOS = position(-470,241,0);
    local DoorItem = base.common.GetFrontItem( User );
    
	if SourceItem:getData("prisonKeyOf") ~= "" then 
	    -- sentence char to forced labour
		SentenceCharacter(User,SourceItem)
	    return
	end	

    if SourceItem.data == 7300 and DoorItem.id == 287 and DoorItem.pos == WALLPOS then

		world:erase(DoorItem,1);
		local charList = world:getPlayersInRangeOf(WALLPOS,15);
		for i,char in pairs(charList) do
			if char.pos.z == WALLPOS.z then
			    base.common.InformNLS(User,"Du hrst das Gerusch von sich verschiebendem Gestein.","You hear the sound of moving stone.");
			end
		end
	elseif base.keys.CheckKey(SourceItem,DoorItem) then
		debug("doorQual "..DoorItem.quality.." data "..DoorItem:getData("lockData"))
		debug("LockDoor: "..base.keys.LockDoor(DoorItem).." UnlockDoor: "..base.keys.UnlockDoor(DoorItem))		
        if base.keys.LockDoor(DoorItem) then
            base.common.InformNLS(User,"Du sperrst die Tr ab.","You lock the door.");
        elseif base.keys.UnlockDoor(DoorItem) then            
{'fraction_non_alphanumeric': 0.1328440366972477, 'fraction_numerical': 0.050642201834862385, 'mean_word_length': 4.172675521821632, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7453805', 'n_tokens_mistral': 1058, 'n_tokens_neox': 939, 'n_words': 194}