This code will do the following:

It will output to the user, the information of other players, with these restrictions:

1) Their defense is lower than that of the requester

AND

2) Their level is in a range of: [level - 5 ; level + 5] of the requester

Those two conditions have to be met, in order for the script to show them.

Code:
 
alias showfarms {
  var %nick = $1
  tokenize 32 $hget(darkhash,$1)
  var %defense = $2, %range = $+($calc($1 -5),-,$calc($1 +5)), %a = 1
  .fopen -o farms farms.tmp
  while $hget(darkhash,%a).data {
    tokenize 32 $v1
    if $2 < %defense && $1 isnum %range { .fwrite -n farms $hget(darkhash,%a).item $1- }
    inc %a
  }
  .fclose farms
  filter -fftc 3 32 farms.tmp farms.tmp *
  if $filtered { .play -a playfarms %nick farms.tmp 1500 }
  else { .msg %nick Im sorry, no farms found for you. }
}
 [color:red]  [/color] 
alias playfarms {
  .msg $1 You can farm $2 he/she is level $3 and has a Defense of $4 - This farm has been submitted by $5 on $6
}

A tip for the future: Try to elaborate as much as you can on what you would like. Try using real examples, and try to illustrate your wishes in a clear way.

This will be the last thing I make for you regarding this script, because it is your bot, you are the scripter, and it should be you who scripts it. Sounds logical. grin

Greets