Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Lua Quick Start Guide
Lua Quick Start Guide

Lua Quick Start Guide: The easiest way to learn Lua programming

eBook
€13.98 €19.99
Paperback
€24.99
Subscription
Free Trial
Renews at €18.99p/m

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Table of content icon View table of contents Preview book icon Preview Book

Lua Quick Start Guide

Introduction to Lua

This chapter covers what Lua is and how to set up a Lua environment on any operating system. Lua is not tied to any operating system, so this chapter covers installing Lua for Windows, macOS, and Linux. By the end of this chapter, you will have a fully functional Lua development environment set up, regardless of what operating system you are using. This will leave you ready to start learning the Lua language.

This is what you will learn in this chapter:

  • What Lua is
  • How to install Lua
  • Available Lua tools
  • How to install Visual Studio Code
  • How to use Visual Studio Code
  • Write and run a Hello World Lua application

Technical requirements

What Lua is

Lua is a powerful, fast, lightweight, embeddable scripting language. The Lua virtual machine and interpreter are written in C. As a language, Lua is easy to learn. It contains 21 keywords, which makes the language rather small. Lua is also easy to read and understand, as its syntax makes it similar to English. For example, consider the following code snippet:

if not hero:IsAlive() then
GameOver();
end

This code is easy to read, and I bet you can take an intuitive guess at what it does. Lua is not only easy to read, it is also very powerful. The real power of Lua comes from its extensible nature. Programming constructs such as object-oriented programming (OOP) can be implemented in Lua, even though the language has no native support for objects.

At the time of writing, Lua has 14 versions; this book will focus on Lua 5.2.4. The latest version is 5.3; the main difference between 5.2 and 5.3 is that 5.3 contains support for explicit integers and bitwise operation.

While this book covers everything needed to get started with Lua programming, it never hurts to have more resources. The first edition of Programming In Lua can be read online, for free, at https://www.lua.org/pil/contents.html.

Source code and binaries

Lua is open source software published under the MIT License. You can browse Lua's source code at https://www.lua.org/source/. Additionally, you can download both the source code and reference manuals for Lua from https://www.lua.org/ftp/.

At the time of writing, no pre-built binaries are downloadable from the lua.org website. Pre-built binaries can be found on SourceForge at https://sourceforge.net/projects/luabinaries/. In this chapter, we will be using SourceForge to download binaries for Lua.

Installing Lua on Windows 10

Follow these steps to install Lua 5.2.4 on Windows 10. These instructions are written for Windows 10, but the steps needed to install should be similar on older (and future) versions of Windows as well:

  1. To download Lua 5.2.4, visit https://sourceforge.net/projects/luabinaries/files/5.2.4/.
  2. Click on the Tools and Executables link.
  3. On a 32-bit version of Windows, click the lua-5.2.4_Win32_bin.zip link to start downloading Lua. On a 64-bit version of Windows, click the lua-5.2.4_Win64_bin.zip link to start downloading.
  4. Once the file is downloaded, unzip the file. Unzipping the downloaded file should create four new files: lua52.dll, lua52.exe, luac52.exe, and wlua52.exe.
  5. Create a new folder inside C:\Program Files, and call this new folder LUA. Copy the four files you just unzipped into this directory.
  6. Rename lua52.exe to lua.exe. If your Windows installation is set up to hide file extensions, rename lua52 to lua:
  1. The path to Lua needs to be set up as an environment variable in Windows.
  2. Right-click on the Start/Windows menu button and select the System option.
  3. From the System window, select the Advanced Settings option.
  4. Having clicked the Advanced Settings option, you should now see the System Properties dialog. In this dialog, click on the Environment Variables... button.

  1. In the Environment Variables window, with the Path variable selected, click the Edit... button:
  1. Inside the Edit environment Variable window, click the New button and add C:\Program Files\LUA as a new path. Click the OK button to save changes and close this window. You can close all the windows we have opened up to this point.
  2. Lua should now be successfully installed on your computer. To verify the installation, you need to launch a new Command Prompt. You can launch Command Prompt by right-clicking the Windows Start/Windows button and selecting the Command Prompt item.
  3. In the newly opened Command Prompt, type lua -v. If everything is set up correctly, the command should print out the installed version of Lua (5.2.4):

Installing Lua on macOS

Follow these steps to install Lua 5.2.4 on macOS. These instructions are written for macOS High Sierra, but the steps are the same on previous (and future) versions of macOS as well:

  1. To download Lua 5.2.4, visit https://sourceforge.net/projects/luabinaries/files/5.2.4/.
  2. Click on the Tools and Executables link.
  3. Click on the lua-4.2.4_MacOS1011_bin.tar.gz link to start downloading Lua.

  1. Once the zip file has downloaded, unzip it. The archive should contain two files, lua52 and luac52:
  1. Create a new folder in your ~/Documents directory, and name this folder LUA. Move both lua52 and luac52 into this new directory:
  1. Rename lua52 to just lua.
  2. Launch a Terminal window. The Terminal app is located at /Applications/Utilities/Terminal.app. You can also simply type Terminal into the universal search on macOS.

  1. With the new Terminal window open, type sudo nano /etc/paths and hit Enter. You will be asked for your password; this is the password for your user account. The password will not show up as you type it. After the password is entered, nano will open; nano is a Terminal-based text editor. You should see something similar to the following window:
  1. You can navigate the type cursor with the arrow keys. Don't worry if your paths file (the file we are editing) already has text in it. We will be adding a new entry into this file; where in the file you add the new entry does not matter. On a new line, type ~Documents/LUA:
  1. Press Ctrl + X to exit nano. The program will ask you if you want to save the changes you have made to the file. Press Y to save changes.
  2. Nano will ask you to confirm the filename. Just hit Enter to accept the default path.

  1. In order for the changes made in the paths to take effect, you must restart the Terminal app. To do this, right-click on the Terminal icon in your macOS dock and select Quit. Then, launch a new Terminal window.
  2. In the new Terminal window, type lua -v. If everything is set up correctly, the Terminal should print out the installed version of Lua (5.2.4):

Installing Lua on Linux

Follow these steps to install Lua 5.2.4 on Linux. These instructions are written for Ubuntu Linux 16.04. The steps needed to install Lua are the same on Ubuntu Linux 12.04 and higher:

  1. The entire installation of Lua can be done using the command line, with the apt package manager.
  2. Open up a new Terminal and type sudo apt-get install lua5.2:
  1. Provide your password when prompted and wait for the installation to finish:
  1. Type lua -v. If everything is set up correctly, the Terminal should print out the installed version of Lua (5.2.4):

Tools for Lua

A programming language relies heavily on the tools that support it. Lua files are plain text files. This means you can write Lua in any text editor you want, whether it is emacs, vi, Sublime Text, TextWrangler, or just the OS-provided basic text editor.

Because of the popularity of Lua, several IDEs, such as ZeroBrane Studio, Decoda, and LuaEdit, have been created for the language. An IDE is an integrated development environment. An IDE comes with everything you need to write, compile, and execute code. There are a number of advanced text editors that have varying levels of support for Lua:

Throughout this book, we will be using Visual Studio Code. VS Code is a free text editor, which supports the Lua syntax with its default installation and works across multiple platforms. The version of VS Code used is 1.9.1, but future versions should work more or less the same way.

Installing VS Code on Windows 10

Setting up VS Code for Windows is very straightforward. The installer takes care of everything for you. These instructions are written for Windows 10, but the process should be the same on all versions of Windows:

  1. Go to http://code.visualstudio.com/ and download the VS Code Code installer for Windows.

  1. Once downloaded, launch the installer exe file. The default options are all valid, so you can hit Next all the way through the installer.
  2. Wait for the installer to finish the setup and exit the installer. There are no further actions to take.

Installing VS Code on macOS

These instructions are written for OSX High Sierra, but the installation steps should be the same on all supported versions of OSX:

  1. Go to http://code.visualstudio.com/ and download VS Code for macOS. This will download a zipped file named VSCode-darwin-stable.zip.
  2. Double-click the zip file to extract its contents. Drag the resulting Visual Studio Code.app file into your Applications directory.
  3. Once Visual Studio Code is in the Applications directory, it is installed, and there are no further actions to take.

Installing VS Code on Linux

These instructions are written for Ubuntu Linux 16.04. The steps needed to install Lua are the same for Ubuntu Linux 12.04 and higher.

  1. Go to http://code.visualstudio.com/ and download the Visual Studio Code installer .deb file. Take note of the name of the downloaded file; the version I am using is named code_1.9.1-1486597190_amd64.deb.
  2. Once downloaded, launch a new Terminal window. Navigate the Terminal to the downloads folder with the following command: cd ~/Downloads.
  3. Next, install the .deb file with the following command: sudo dpkg -i ./code_1.9.1-1486597190_amd64.deb. The filename might be different based on the version of VS Code you downloaded.
  4. Fix any missing or broken dependencies with the following command: sudo apt-get install -f.
  5. Visual Studio Code is now installed, and there are no further actions to take.

Exploring VS Code

It's important to be familiar with the tools you use. While Visual Studio Code is primarily a text editor, it does boast a rather large set of IDE-like features. VS Code can easily become overwhelming if you are not familiar with using it.

Visual Studio Code is a powerful text editor with many advanced features. If you are interested in learning more about the editor than this section covers, visit the online basics guide at https://code.visualstudio.com/docs/editor/codebasics.

Follow these steps to gain some familiarity and intuition with Visual Studio Code:

  1. When you open up Visual Studio Code, you are greeted with either the last open documents, the welcome page, or if you have no documents open and the welcome page is disabled, the default window.
  2. The icons on the left side of the screen make up what is called the View bar. Clicking any of the items on the View bar will cause a side bar to become visible:
  1. The first item on the View bar is the Explorer. You can use the Explorer to open a folder and View all of the files in that folder in one convenient list. We will use this feature of the editor throughout the next few chapters:
  1. The search item on the bar will let you search for and replace text in either open documents, or documents inside of the currently open folder.

  1. The GIT item on the View bar will only be available if the currently open folder is a git repository. VS Code has excellent git integration! While source control solutions such as git are outside the scope of this book, using some kind of source control is highly recommended:
  1. The DEBUG sidebar gives VS Code IDE features such as break points and a watch window:
  1. Finally, the EXTENSIONS item will show you a side bar that can be used to View, manage, and install new extensions in Visual Studio Code:
  1. To make a new file, simply select File > New File.
  2. This opens a new file, in a new tab. This file has no syntax highlighting yet. To assign a syntax, click on the Plain Text label in the bottom-right of the code tab, then select Lua (lua) from the drop-down menu that appears:
  1. If at any point you open a file and it does not have proper syntax highlighting, you can follow the previous step to force the file to have Lua syntax highlighting. In the previous step, we set the syntax of the file manually. If you save a file with a .lua extension, the next time the file is opened, it will automatically use Lua syntax highlighting.

Hello World!

It is common practice when first learning a new programming language to create a Hello World program. This is a simple program that prints the words Hello World to the screen. The goal of this exercise is to write, compile (or interpret), and run a simple piece of code to prove that you can execute it.

The program will be written using Visual Studio Code, but how will it be executed? Visual Studio Code provides an Integrated Terminal. This is a Terminal that should work the same way regardless of what operating system you are using. It's important to note that whatever code gets executed through this Terminal can also be executed through the operating system Terminal/shell.

Being able to perform the same steps regardless of operating system can save time and reduce errors. For this reason, future chapters will assume code will be executed in VS Code instead of the native Terminal of each operating system.

The Lua interpreter was set up as a global command in the console of your operating system. You should be able to execute any Lua file with the command lua from a console/Terminal.

Follow these steps to create a Hello World program, save it, and execute it on any platform (macOS, Windows 10, or Linux):

  1. Open Visual Studio Code and make a new document with File > New.
  2. Set the syntax highlighting of this file to the Lua syntax. Click on the Plain Text label in the bottom right of the code tab, then select Lua (lua) from the drop-down menu that appears:
  1. In this new file, type print ('hello, world'):

  1. Save the file to your desktop and name it hello.lua.
  2. From the top menu of Visual Studio Code, select View > Integrated Terminal.
  3. On all platforms, if you did not have a folder open, the editor starts out in your home directory. If you did have a folder open, the editor starts out in the folder. Navigate to your desktop with the following command: cd ~/Desktop; the ~/ part of the path is shorthand for home directory:
  1. Now that the Terminal has the desktop directory open (which is where hello.lua should be saved), you can execute the Lua file with the following command: lua hello.lua. You should see hello, world printed to the Terminal.

The last step invoked the Lua binary from the Terminal of Visual Studio with the hello.lua file as an argument. This, in turn, launched the Lua runtime, which executed the file that was provided as an argument. If the Lua runtime did not launch, you may want to review how to set the runtime up in the Tools for Lua section.

Summary

This chapter covered how to install Lua and VS Code. VS Code is the development environment that will be used throughout this book to write and execute Lua code. The integrated Terminal in Visual Studio Code allows us to execute code the same way on all three major platforms: Windows, Linux, and macOS.

In the next chapter, we will start to write code. The basics of Lua, such as variables, loops, if statements, and functions, will be covered. The topics covered in the next chapter are the basics of programming; it is going to be one of the most important chapters in this book.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • The easiest way to learn Lua coding
  • Use the Lua standard libraries and debug Lua code
  • Embed Lua as a scripting language using the Lua C API

Description

Lua is a small, powerful and extendable scripting/programming language that can be used for learning to program, and writing games and applications, or as an embedded scripting language. There are many popular commercial projects that allow you to modify or extend them through Lua scripting, and this book will get you ready for that. This book is the easiest way to learn Lua. It introduces you to the basics of Lua and helps you to understand the problems it solves. You will work with the basic language features, the libraries Lua provides, and powerful topics such as object-oriented programming. Every aspect of programming in Lua, variables, data types, functions, tables, arrays and objects, is covered in sufficient detail for you to get started. You will also find out about Lua's module system and how to interface with the operating system. After reading this book, you will be ready to use Lua as a programming language to write code that can interface with the operating system, automate tasks, make playable games, and much more. This book is a solid starting point for those who want to learn Lua in order to move onto other technologies such as Love2D or Roblox. A quick start guide is a focused, shorter title that provides a faster paced introduction to a technology. It is designed for people who don't need all the details at this point in their learning curve. This presentation has been streamlined to concentrate on the things you really need to know.

Who is this book for?

This book is for developers who want to get up and running with Lua. This book is ideal for programmers who want to learn to embed Lua in their own applications, as well as for beginner programmers who have never coded before.

What you will learn

  • • Understand the basics of programming the Lua language
  • • Understand how to use tables, the data structure that makes Lua so powerful
  • • Understand object-oriented programming in Lua using metatables
  • • Understand standard LUA libraries for math, file io, and more
  • • Manipulate string data using Lua
  • • Understand how to debug Lua applications quickly and effciently
  • • Understand how to embed Lua into applications with the Lua C API
Estimated delivery fee Deliver to Slovenia

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Jul 27, 2018
Length: 202 pages
Edition : 1st
Language : English
ISBN-13 : 9781789343229
Category :
Languages :

What do you get with Print?

Product feature icon Instant access to your digital eBook copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Estimated delivery fee Deliver to Slovenia

Premium delivery 7 - 10 business days

€25.95
(Includes tracking information)

Product Details

Publication date : Jul 27, 2018
Length: 202 pages
Edition : 1st
Language : English
ISBN-13 : 9781789343229
Category :
Languages :

Packt Subscriptions

See our plans and pricing
Modal Close icon
€18.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
€189.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts
€264.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just €5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 103.97
Learning game AI programming with Lua
€36.99
Lua Game Development Cookbook
€41.99
Lua Quick Start Guide
€24.99
Total 103.97 Stars icon

Table of Contents

9 Chapters
Introduction to Lua Chevron down icon Chevron up icon
Working with Lua Chevron down icon Chevron up icon
Tables and Objects Chevron down icon Chevron up icon
Lua Libraries Chevron down icon Chevron up icon
Debugging Lua Chevron down icon Chevron up icon
Embedding Lua Chevron down icon Chevron up icon
Lua Bridge Chevron down icon Chevron up icon
Next Steps Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Half star icon Empty star icon 3.6
(8 Ratings)
5 star 37.5%
4 star 25%
3 star 12.5%
2 star 12.5%
1 star 12.5%
Filter icon Filter
Top Reviews

Filter reviews by




Shannon Nov 03, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
It covers the basic run through of the Lua code and that is just what I needed.
Amazon Verified review Amazon
Edward Beck Dec 12, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Nice book easy to follow.
Amazon Verified review Amazon
Rufinity Feb 25, 2021
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Still learning. Very informational
Amazon Verified review Amazon
Brandon Mar 04, 2024
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
Overall a good introduction to Lua and programming, however there are a few chapters that feel a little out of place and far more in depth for what I would consider a "quick start" guide.
Subscriber review Packt
William Aug 04, 2022
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
The author does a reasonable job of showcasing the language to help someone get started in LUA quickly. I am using it to help teach a beginner how to program. The languag and style is down to earth and should be accessible to most people. NOTE- This book does not teach the art of programming, it is literally just a quick-start for LUA. If you want a book that teaches the art of programming using LUA you should look elsewhere.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela