Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Expected Identifier


Eviltyphoon
 Share

Recommended Posts

Expected Identifier error
Line 1 column 11 on this code:

```
Sub Skills(Type)
Dim a
Dim b

Select case type
Case WC
a = 50
b = 10
If Getplayerweaponslot(index) = 5 Then
  Call BattleMsg(index, "You start to chop at the tree!, BLUE, 1)
  Do while GetPlayerStr(index) < a
    a = a - 5
    b = b - 1
  Loop
  Call Settimer("Woodcutting " & index, Rand(Int(1 + b), Int(2 + b))
  Call Playermsg(index, Rand(Int(1 + b), Int(2 + b))
  Call LockPlayer(index, 1)
  Call LockSpells(index, 1)
  Call LockItems(index, 1)
  Call LockAttack(index, 1)
Else
  Call PlayerMsg(index, "You need an axe to cut wood!", RED)
End If
Exit Sub

Case M
Exit Sub
End Select
End Sub
```
Which is the '('

Any ideas?

Thx in advance,
Ace of Clubs AKA Eviltyphoon
Link to comment
Share on other sites

Found afew problems.
First, your first battlemsg:
Call BattleMsg(index, "You start to chop at the tree!, BLUE, 1)
For forgot to end the string (with a double-quote), could could lead to quite afew problems.

"Type" is a reserved word; not sure if you're using it as a variable or not, but I don't think it will let you if you try.

Also, don't subs need an "index" too?
Link to comment
Share on other sites

@ÅÐмiядζ:

> Found afew problems.
> First, your first battlemsg:
> Call BattleMsg(index, "You start to chop at the tree!, BLUE, 1)
> For forgot to end the string (with a double-quote), could could lead to quite afew problems.

I always make these kinds of mistakes :(

@ÅÐмiядζ:

> Also, don't subs need an "index" too?

Yeah, but I posted the wrong one;.. :/

@ÅÐмiядζ:

> "Type" is a reserved word; not sure if you're using it as a variable or not, but I don't think it will let you if you try.

@Xeross:

> Ye it might be because Type is reserved try skillName instead or something similiar.
>
> Regards, Xeross

It works! Thx!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...