Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
tg
Commits
dc38df06
Commit
dc38df06
authored
Aug 26, 2014
by
vvaltman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated test lua script
parent
8625cb22
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
8 deletions
+22
-8
main.c
main.c
+2
-2
test.lua
test.lua
+20
-6
No files found.
main.c
View file @
dc38df06
...
@@ -418,7 +418,7 @@ void args_parse (int argc, char **argv) {
...
@@ -418,7 +418,7 @@ void args_parse (int argc, char **argv) {
"B"
"B"
#endif
#endif
#ifdef USE_LUA
#ifdef USE_LUA
"s"
"s
:
"
#endif
#endif
))
!=
-
1
)
{
))
!=
-
1
)
{
...
@@ -475,7 +475,7 @@ void args_parse (int argc, char **argv) {
...
@@ -475,7 +475,7 @@ void args_parse (int argc, char **argv) {
break
;
break
;
#ifdef USE_LUA
#ifdef USE_LUA
case
's'
:
case
's'
:
lua_file
=
t
strdup
(
optarg
);
lua_file
=
strdup
(
optarg
);
break
;
break
;
#endif
#endif
case
'W'
:
case
'W'
:
...
...
test.lua
View file @
dc38df06
...
@@ -40,7 +40,17 @@ end
...
@@ -40,7 +40,17 @@ end
print
(
"HI, this is lua script"
)
print
(
"HI, this is lua script"
)
function
ok_cb
(
extra
,
success
,
result
)
if
success
then
print
(
"SUCCESS!\n"
)
end
end
function
my_set_chat_photo
(
extra
,
success
,
file
)
if
success
then
chat_set_photo
(
extra
,
file
,
ok_cb
,
false
)
end
end
function
on_msg_receive
(
msg
)
function
on_msg_receive
(
msg
)
if
started
==
0
then
if
started
==
0
then
...
@@ -49,6 +59,10 @@ function on_msg_receive (msg)
...
@@ -49,6 +59,10 @@ function on_msg_receive (msg)
if
msg
.
out
then
if
msg
.
out
then
return
return
end
end
if
msg
.
media
==
'photo'
and
msg
.
to
.
type
==
'chat'
then
load_photo
(
msg
.
id
,
my_set_chat_photo
,
msg
.
to
.
print_name
)
end
if
(
msg
.
text
==
'ping'
)
then
if
(
msg
.
text
==
'ping'
)
then
if
(
msg
.
to
.
id
==
our_id
)
then
if
(
msg
.
to
.
id
==
our_id
)
then
print
(
'sending pong to '
..
tostring
(
msg
.
from
.
print_name
))
print
(
'sending pong to '
..
tostring
(
msg
.
from
.
print_name
))
...
@@ -75,16 +89,16 @@ function on_our_id (id)
...
@@ -75,16 +89,16 @@ function on_our_id (id)
our_id
=
id
our_id
=
id
end
end
function
on_
secret_chat_created
(
peer
)
function
on_
user_update
(
user
,
what
)
--vardump (
pe
er)
--vardump (
us
er)
end
end
function
on_
user_update
(
user
)
function
on_
chat_update
(
chat
,
what
)
--vardump (
user
)
--vardump (
chat
)
end
end
function
on_
chat_update
(
user
)
function
on_
secret_chat_update
(
schat
,
what
)
--vardump (
user
)
--vardump (
schat
)
end
end
function
on_get_difference_end
()
function
on_get_difference_end
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment