I answered my own question:
float range = 3.0; // metres
key reader_key;
key reader_name_query;
integer online = FALSE;
string whotocheck= "";
default
{
//====== Gather info ======
touch(integer touch_num)
{
reader_key = (key)llGetObjectDesc ();
//Who is the current reader
whotocheck = llDetectedKey(0);
//Who wants to read
//====== Check if 'Whoto check' is the curret reader ======
if(reader_key != whotocheck)
//check if current reader and new reader are the same person
{
llSay(0,"You are not the current reader reader."

;//Test value
//====== Check if current reader is offline ======
llRequestAgentData(reader_key, DATA_ONLINE);
}
}
dataserver(key queryid, string data)//Get the result of the request
{
llSay(0,data); //Test value
if (data == "1"

// If reader is online
//====== Check if reader is within 3 meters ======
{
llSensor("", reader_key, AGENT, range, PI); //see float range varaible)
}
}
sensor (integer numberDetected)//Get scan result
{
string msg = "Detected " + llDetectedName(0);//turn result into a string
integer i = 0;//Garbbage collection
{
msg += ", " + llDetectedName(i);//cleaning out the string
}
llSay(0, msg);//Test value
llSetText("Go to Bookmark", <0,1,0>, 1);
}
no_sensor()//If not within 3 meters
{
llSay(0, "Previous reader is not near me."

;//Test value
llSetText("Closed Book", <0,1,0>, 1);
}
}